├── .gitignore ├── Config ├── app.json ├── clients.json ├── crypto.json ├── droplet.json ├── production │ └── app.json ├── secrets │ └── postgresql.json └── servers.json ├── HelloVapor.xcodeproj ├── Auth_Info.plist ├── BCrypt_Info.plist ├── CLibreSSL_Info.plist ├── Cache_Info.plist ├── Cipher_Info.plist ├── Console_Info.plist ├── Cookies_Info.plist ├── Core_Info.plist ├── Essentials_Info.plist ├── FluentPostgreSQL_Info.plist ├── FluentTester_Info.plist ├── Fluent_Info.plist ├── FormData_Info.plist ├── GeneratedModuleMap │ └── CLibreSSL │ │ └── module.modulemap ├── HMAC_Info.plist ├── HTTPRouting_Info.plist ├── HTTP_Info.plist ├── Hash_Info.plist ├── JSON_Info.plist ├── Jay_Info.plist ├── Leaf_Info.plist ├── Multipart_Info.plist ├── Node_Info.plist ├── PathIndexable_Info.plist ├── Polymorphic_Info.plist ├── PostgreSQL_Info.plist ├── Random_Info.plist ├── Routing_Info.plist ├── SMTP_Info.plist ├── Sessions_Info.plist ├── Settings_Info.plist ├── SocksCore_Info.plist ├── Socks_Info.plist ├── TLS_Info.plist ├── Transport_Info.plist ├── TurnstileCrypto_Info.plist ├── TurnstileWeb_Info.plist ├── Turnstile_Info.plist ├── TypeSafeRouting_Info.plist ├── URI_Info.plist ├── VaporPostgreSQL_Info.plist ├── Vapor_Info.plist ├── WebSockets_Info.plist ├── libc_Info.plist ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── HelloVapor.xcscmblueprint └── xcshareddata │ └── xcschemes │ ├── HelloVapor.xcscheme │ └── xcschememanagement.plist ├── LICENSE ├── Localization ├── default.json ├── en-US.json ├── es-US.json ├── nl-BE.json └── nl-NL.json ├── Package.swift ├── Procfile ├── Public ├── home │ ├── images │ │ ├── home-center-banner.png │ │ └── vapor-logo.png │ └── styles │ │ └── app.css ├── share │ ├── images │ │ ├── av95108_1_1477481744.jpg │ │ ├── location2x.png │ │ ├── red-line.png │ │ └── vote_num2x.png │ └── styles │ │ ├── js │ │ └── jquery-1.11.3.min.js │ │ └── mob.css └── srsq │ ├── images │ ├── app-2.png │ ├── awe-1.jpg │ ├── awe-2.jpg │ ├── awe-3.jpg │ ├── awe-4.jpg │ ├── bn-sprit.png │ ├── btn-1.png │ ├── btn-2.png │ ├── est-banner.png │ ├── feature-1.png │ ├── ftr-bnr.png │ ├── ftr-fve.png │ ├── ftr-fvr.png │ ├── ftr-one.png │ ├── ftr-tre.png │ ├── ftr-two.png │ ├── get-bnr.jpg │ ├── iphone.png │ ├── men-2.png │ ├── msg.png │ ├── nav-icon.png │ ├── ph.png │ ├── point.png │ ├── quote-1.png │ ├── quote-2.png │ ├── social.png │ ├── star.png │ └── up-arrow.png │ └── styles │ ├── bootstrap.css │ ├── js │ ├── easing.js │ ├── jquery-1.11.0.min.js │ └── move-top.js │ └── style.css ├── README.md ├── Resources └── Views │ ├── base.leaf │ ├── embeds │ └── header.leaf │ ├── home │ └── welcome.html │ ├── share │ └── index.html │ ├── srsq │ └── index.html │ ├── template.leaf │ └── welcome.leaf ├── Sources └── App │ ├── Controllers │ └── PostController.swift │ ├── Models │ ├── EBUser.swift │ ├── Post.swift │ ├── SQActive.swift │ ├── SQAllUser.swift │ ├── SQAnimal.swift │ ├── SQBanner.swift │ ├── SQFriend.swift │ ├── SQPerson.swift │ ├── SQPic.swift │ ├── SQProfile.swift │ ├── SQRcToken.swift │ └── UInt32+Random.swift │ └── main.swift └── app.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /Config/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "foo-bar" 3 | } 4 | -------------------------------------------------------------------------------- /Config/clients.json: -------------------------------------------------------------------------------- 1 | { 2 | "tls": { 3 | "verifyHost": false, 4 | "verifyCertificates": false, 5 | "certificates": "defaults" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Config/crypto.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": { 3 | "method": "sha256", 4 | "key": "password" 5 | }, 6 | "cipher": { 7 | "method": "chacha20", 8 | "key": "passwordpasswordpasswordpassword", 9 | "iv": "password" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Config/droplet.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": "engine", 3 | "client": "engine", 4 | "console": "terminal", 5 | "log": "console", 6 | "hash": "crypto", 7 | "cipher": "crypto", 8 | "middleware": { 9 | "server": [ 10 | "file", 11 | "abort", 12 | "validation", 13 | "type-safe", 14 | "date", 15 | "sessions" 16 | ], 17 | "client": [ 18 | 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Config/production/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "$VAPOR_APP_KEY" 3 | } -------------------------------------------------------------------------------- /Config/secrets/postgresql.json: -------------------------------------------------------------------------------- 1 | { 2 | "host": "127.0.0.1", 3 | "user": "admin", 4 | "password": "admin", 5 | "database": "srsq", 6 | "port": 5432 7 | } 8 | -------------------------------------------------------------------------------- /Config/servers.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": { 3 | "port": "$PORT:8080", 4 | "host": "0.0.0.0", 5 | "securityLayer": "none" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Auth_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/BCrypt_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/CLibreSSL_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Cache_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Cipher_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Console_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Cookies_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Core_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Essentials_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/FluentPostgreSQL_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/FluentTester_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Fluent_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/FormData_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/GeneratedModuleMap/CLibreSSL/module.modulemap: -------------------------------------------------------------------------------- 1 | module CLibreSSL { 2 | umbrella header "/Users/cailingyun/HelloVapor/Packages/CLibreSSL-1.0.0/Sources/CLibreSSL/include/CLibreSSL.h" 3 | link "CLibreSSL" 4 | export * 5 | } 6 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/HMAC_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/HTTPRouting_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/HTTP_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Hash_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/JSON_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Jay_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Leaf_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Multipart_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Node_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/PathIndexable_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Polymorphic_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/PostgreSQL_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Random_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Routing_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/SMTP_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Sessions_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Settings_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/SocksCore_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Socks_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/TLS_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Transport_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/TurnstileCrypto_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/TurnstileWeb_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Turnstile_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/TypeSafeRouting_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/URI_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/VaporPostgreSQL_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/Vapor_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/WebSockets_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/libc_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CFBundleDevelopmentRegion 5 | en 6 | CFBundleExecutable 7 | $(EXECUTABLE_NAME) 8 | CFBundleIdentifier 9 | $(PRODUCT_BUNDLE_IDENTIFIER) 10 | CFBundleInfoDictionaryVersion 11 | 6.0 12 | CFBundleName 13 | $(PRODUCT_NAME) 14 | CFBundlePackageType 15 | FMWK 16 | CFBundleShortVersionString 17 | 1.0 18 | CFBundleSignature 19 | ???? 20 | CFBundleVersion 21 | $(CURRENT_PROJECT_VERSION) 22 | NSPrincipalClass 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/project.xcworkspace/xcshareddata/HelloVapor.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "23D5251AE9FC10522C0BBCA54B72CB2B3DEBFBF8", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "8FE2B4BB55A3C9D7B3B78FD1E2302636E924BDDC" : 9223372036854775807, 8 | "23D5251AE9FC10522C0BBCA54B72CB2B3DEBFBF8" : 9223372036854775807 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "41EA5A6B-B68F-4C82-BCE1-847CE3C5092B", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "8FE2B4BB55A3C9D7B3B78FD1E2302636E924BDDC" : "HelloVapor\/Packages\/Jay-1.0.1\/", 13 | "23D5251AE9FC10522C0BBCA54B72CB2B3DEBFBF8" : "HelloVapor\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "HelloVapor", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "HelloVapor.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/git.heroku.com\/srsq.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "23D5251AE9FC10522C0BBCA54B72CB2B3DEBFBF8" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/DanToml\/Jay.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "8FE2B4BB55A3C9D7B3B78FD1E2302636E924BDDC" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/xcshareddata/xcschemes/HelloVapor.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 57 | 63 | 64 | 65 | 71 | 77 | 78 | 79 | 85 | 91 | 92 | 93 | 99 | 105 | 106 | 107 | 113 | 119 | 120 | 121 | 127 | 133 | 134 | 135 | 141 | 147 | 148 | 149 | 155 | 161 | 162 | 163 | 169 | 175 | 176 | 177 | 183 | 189 | 190 | 191 | 197 | 203 | 204 | 205 | 211 | 217 | 218 | 219 | 225 | 231 | 232 | 233 | 239 | 245 | 246 | 247 | 253 | 259 | 260 | 261 | 267 | 273 | 274 | 275 | 281 | 287 | 288 | 289 | 295 | 301 | 302 | 303 | 309 | 315 | 316 | 317 | 323 | 329 | 330 | 331 | 337 | 343 | 344 | 345 | 351 | 357 | 358 | 359 | 365 | 371 | 372 | 373 | 379 | 385 | 386 | 387 | 393 | 399 | 400 | 401 | 407 | 413 | 414 | 415 | 421 | 427 | 428 | 429 | 435 | 441 | 442 | 443 | 449 | 455 | 456 | 457 | 463 | 469 | 470 | 471 | 477 | 483 | 484 | 485 | 491 | 497 | 498 | 499 | 505 | 511 | 512 | 513 | 519 | 525 | 526 | 527 | 533 | 539 | 540 | 541 | 547 | 553 | 554 | 555 | 561 | 567 | 568 | 569 | 575 | 581 | 582 | 583 | 589 | 595 | 596 | 597 | 603 | 609 | 610 | 611 | 617 | 623 | 624 | 625 | 626 | 627 | 632 | 633 | 634 | 635 | 636 | 637 | 647 | 648 | 654 | 655 | 656 | 657 | 658 | 659 | 665 | 666 | 668 | 669 | 672 | 673 | 674 | -------------------------------------------------------------------------------- /HelloVapor.xcodeproj/xcshareddata/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SchemeUserState 5 | 6 | HelloVapor.xcscheme 7 | 8 | 9 | SuppressBuildableAutocreation 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Localization/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": { 3 | "title": "It works." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Localization/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": { 3 | "title": "It works." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Localization/es-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": { 3 | "title": "Funciona." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Localization/nl-BE.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": { 3 | "title": "Het werkt." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Localization/nl-NL.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": { 3 | "title": "Het werkt." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "HelloVapor", 5 | dependencies: [ 6 | .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 5), 7 | .Package(url: "https://github.com/vapor/postgresql-provider", majorVersion: 1, minor: 0) 8 | ], 9 | exclude: [ 10 | "Config", 11 | "Database", 12 | "Localization", 13 | "Public", 14 | "Resources", 15 | ] 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: App --env=production --workdir="./" 2 | web: App --env=production --workdir=./ --config:servers.default.port=$PORT --config:postgresql.url=$DATABASE_URL 3 | 4 | -------------------------------------------------------------------------------- /Public/home/images/home-center-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/home/images/home-center-banner.png -------------------------------------------------------------------------------- /Public/home/images/vapor-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/home/images/vapor-logo.png -------------------------------------------------------------------------------- /Public/home/styles/app.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body, html { 6 | padding: 0; 7 | margin: 0; 8 | height: 100%; 9 | } 10 | 11 | body { 12 | font-family: sans-serif; 13 | color: #333; 14 | position: relative; 15 | } 16 | 17 | 18 | a { 19 | color: #92A8D1; 20 | text-decoration: none; 21 | border-bottom: 1px dotted; 22 | } 23 | 24 | a:hover { 25 | color: #F7CAC9; 26 | } 27 | 28 | div.wrapper { 29 | width: 100%; 30 | max-width: 600px; 31 | margin: 0 auto; 32 | position: relative; 33 | top: 50%; 34 | transform: translateY(-50%); 35 | margin-top: -25px; //adjust eye level 36 | } 37 | h1#home { 38 | text-indent: -9999px; 39 | text-align: center; 40 | margin-top: 20px; 41 | width: 100px; 42 | height: 30px; 43 | margin: 0 auto; 44 | } 45 | h1#logo { 46 | background-image: url(../images/home-center-banner.png); 47 | background-size: 100%; 48 | width: 200px; 49 | height: 354px; 50 | margin: 0 auto; 51 | } 52 | 53 | nav.main { 54 | text-align: center; 55 | margin-top: 20px; 56 | } 57 | nav.main ul { 58 | margin: 0; 59 | padding: 0; 60 | } 61 | nav.main ul li { 62 | display: inline-block; 63 | padding: 0 5px; 64 | } 65 | 66 | 67 | footer.main { 68 | position: absolute; 69 | width: 100%; 70 | text-align: center; 71 | bottom: 0px; 72 | font-size: 15px; 73 | } 74 | 75 | footer.main p { 76 | margin: 0; 77 | padding: 0; 78 | color: #ffffff; 79 | font-weight: 200; 80 | } 81 | 82 | footer.main p a { 83 | color: #ffffff; 84 | } 85 | -------------------------------------------------------------------------------- /Public/share/images/av95108_1_1477481744.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/share/images/av95108_1_1477481744.jpg -------------------------------------------------------------------------------- /Public/share/images/location2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/share/images/location2x.png -------------------------------------------------------------------------------- /Public/share/images/red-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/share/images/red-line.png -------------------------------------------------------------------------------- /Public/share/images/vote_num2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/share/images/vote_num2x.png -------------------------------------------------------------------------------- /Public/share/styles/mob.css: -------------------------------------------------------------------------------- 1 | #content{ 2 | padding-bottom:55px; 3 | } 4 | h1 { 5 | border-bottom: 1px solid #333; 6 | font-size: 17px; 7 | padding: 10px; 8 | text-align: center; 9 | } 10 | body { 11 | background-color: #000; 12 | color: white; 13 | } 14 | * { 15 | color: white; 16 | margin: 0; 17 | padding: 0; 18 | } 19 | .head { 20 | height: 50px; 21 | padding: 10px; 22 | } 23 | #avatar { 24 | border-radius: 50%; 25 | float: left; 26 | height: 50px; 27 | margin-right: 10px; 28 | } 29 | #photo img { 30 | width: 100%; 31 | } 32 | #level { 33 | font-size: 14px; 34 | position: relative; 35 | top: 50%; 36 | transform: translateY(-50%); 37 | -webkit-transform: translateY(-50%); 38 | line-height:20px; 39 | } 40 | #grade-name{ 41 | 12px; 42 | } 43 | #photo-spec { 44 | color: #666; 45 | padding: 20px; 46 | float:right; 47 | text-align: right; 48 | } 49 | #photo-spec *{ 50 | color:#777; 51 | font-size:10px; 52 | } 53 | #photo-content { 54 | float: left; 55 | padding: 10px; 56 | width:60%; 57 | } 58 | #photo-content img{ 59 | vertical-align:middle; 60 | } 61 | #photo-voteup { 62 | background: url(/img/voteup@2x.png) no-repeat scroll 90% 2px white; 63 | background: -webkit-image-set(url(/img/voteup@2x.png) 2x) no-repeat scroll 92% 2px white; 64 | border-radius: 25px; 65 | float: right; 66 | height: 39px; 67 | margin-top: 18px; 68 | max-width: 100px; 69 | padding-left: 12px; 70 | padding-right: 48px; 71 | text-align: left; 72 | vertical-align: bottom; 73 | } 74 | #voteup-point{ 75 | position:relative; 76 | top:50%; 77 | font-size: 15px; 78 | transform:translateY(-50%); 79 | -webkit-transform:translateY(-50%); 80 | color: #ff524f; 81 | } 82 | #footer{ 83 | clear:both; 84 | text-align:center; 85 | margin:10px auto; 86 | font-size:12px; 87 | color:#959595; 88 | } 89 | #user-spec{ 90 | float:right; 91 | position:relative; 92 | top:50%; 93 | transform:translateY(-50%); 94 | -webkit-transform: translateY(-50%); 95 | text-align:right; 96 | line-height:18px; 97 | } 98 | #user-spec img{ 99 | } 100 | #user-spec *{ 101 | font-size:12px; 102 | vertical-align:middle; 103 | } 104 | #photos{ 105 | margin-left:5px; 106 | margin-right:5px; 107 | } 108 | .photo-item{ 109 | width:32.0%; 110 | display:inline-block; 111 | } 112 | .photo-item img{width:100%} 113 | .grey{ 114 | color:#959595; 115 | } 116 | #download{ 117 | position:fixed; 118 | text-align:center; 119 | margin:0px auto; 120 | left:0; 121 | right:0; 122 | font-size:12px; 123 | bottom:0px; 124 | margin-top:10px; 125 | background-color:black; 126 | padding-bottom:16px; 127 | } 128 | .redline{margin-bottom:10px;} 129 | #download a{ 130 | font-size:20px; 131 | display:block; 132 | text-decoration:none; 133 | } 134 | #footer{display:none} 135 | @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-devicepixel-ratio: 1.5), only screen and (min-resolution: 1.5dppx) { 136 | #photo-voteup{ 137 | background-image: url(/img/voteup.png) no-repeat; 138 | background-size:35px; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Public/srsq/images/app-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/app-2.png -------------------------------------------------------------------------------- /Public/srsq/images/awe-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/awe-1.jpg -------------------------------------------------------------------------------- /Public/srsq/images/awe-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/awe-2.jpg -------------------------------------------------------------------------------- /Public/srsq/images/awe-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/awe-3.jpg -------------------------------------------------------------------------------- /Public/srsq/images/awe-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/awe-4.jpg -------------------------------------------------------------------------------- /Public/srsq/images/bn-sprit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/bn-sprit.png -------------------------------------------------------------------------------- /Public/srsq/images/btn-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/btn-1.png -------------------------------------------------------------------------------- /Public/srsq/images/btn-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/btn-2.png -------------------------------------------------------------------------------- /Public/srsq/images/est-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/est-banner.png -------------------------------------------------------------------------------- /Public/srsq/images/feature-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/feature-1.png -------------------------------------------------------------------------------- /Public/srsq/images/ftr-bnr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ftr-bnr.png -------------------------------------------------------------------------------- /Public/srsq/images/ftr-fve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ftr-fve.png -------------------------------------------------------------------------------- /Public/srsq/images/ftr-fvr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ftr-fvr.png -------------------------------------------------------------------------------- /Public/srsq/images/ftr-one.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ftr-one.png -------------------------------------------------------------------------------- /Public/srsq/images/ftr-tre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ftr-tre.png -------------------------------------------------------------------------------- /Public/srsq/images/ftr-two.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ftr-two.png -------------------------------------------------------------------------------- /Public/srsq/images/get-bnr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/get-bnr.jpg -------------------------------------------------------------------------------- /Public/srsq/images/iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/iphone.png -------------------------------------------------------------------------------- /Public/srsq/images/men-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/men-2.png -------------------------------------------------------------------------------- /Public/srsq/images/msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/msg.png -------------------------------------------------------------------------------- /Public/srsq/images/nav-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/nav-icon.png -------------------------------------------------------------------------------- /Public/srsq/images/ph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/ph.png -------------------------------------------------------------------------------- /Public/srsq/images/point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/point.png -------------------------------------------------------------------------------- /Public/srsq/images/quote-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/quote-1.png -------------------------------------------------------------------------------- /Public/srsq/images/quote-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/quote-2.png -------------------------------------------------------------------------------- /Public/srsq/images/social.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/social.png -------------------------------------------------------------------------------- /Public/srsq/images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/star.png -------------------------------------------------------------------------------- /Public/srsq/images/up-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeruik/SRSQ-Vapor/a9333a68c355ef35c561b9721d8044da69fd1cb1/Public/srsq/images/up-arrow.png -------------------------------------------------------------------------------- /Public/srsq/styles/js/easing.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php 3 | * 4 | * Uses the built In easIng capabilities added In jQuery 1.1 5 | * to offer multiple easIng options 6 | * 7 | * Copyright (c) 2007 George Smith 8 | * Licensed under the MIT License: 9 | * http://www.opensource.org/licenses/mit-license.php 10 | */ 11 | 12 | // t: current time, b: begInnIng value, c: change In value, d: duration 13 | 14 | jQuery.extend( jQuery.easing, 15 | { 16 | easeInQuad: function (x, t, b, c, d) { 17 | return c*(t/=d)*t + b; 18 | }, 19 | easeOutQuad: function (x, t, b, c, d) { 20 | return -c *(t/=d)*(t-2) + b; 21 | }, 22 | easeInOutQuad: function (x, t, b, c, d) { 23 | if ((t/=d/2) < 1) return c/2*t*t + b; 24 | return -c/2 * ((--t)*(t-2) - 1) + b; 25 | }, 26 | easeInCubic: function (x, t, b, c, d) { 27 | return c*(t/=d)*t*t + b; 28 | }, 29 | easeOutCubic: function (x, t, b, c, d) { 30 | return c*((t=t/d-1)*t*t + 1) + b; 31 | }, 32 | easeInOutCubic: function (x, t, b, c, d) { 33 | if ((t/=d/2) < 1) return c/2*t*t*t + b; 34 | return c/2*((t-=2)*t*t + 2) + b; 35 | }, 36 | easeInQuart: function (x, t, b, c, d) { 37 | return c*(t/=d)*t*t*t + b; 38 | }, 39 | easeOutQuart: function (x, t, b, c, d) { 40 | return -c * ((t=t/d-1)*t*t*t - 1) + b; 41 | }, 42 | easeInOutQuart: function (x, t, b, c, d) { 43 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b; 44 | return -c/2 * ((t-=2)*t*t*t - 2) + b; 45 | }, 46 | easeInQuint: function (x, t, b, c, d) { 47 | return c*(t/=d)*t*t*t*t + b; 48 | }, 49 | easeOutQuint: function (x, t, b, c, d) { 50 | return c*((t=t/d-1)*t*t*t*t + 1) + b; 51 | }, 52 | easeInOutQuint: function (x, t, b, c, d) { 53 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; 54 | return c/2*((t-=2)*t*t*t*t + 2) + b; 55 | }, 56 | easeInSine: function (x, t, b, c, d) { 57 | return -c * Math.cos(t/d * (Math.PI/2)) + c + b; 58 | }, 59 | easeOutSine: function (x, t, b, c, d) { 60 | return c * Math.sin(t/d * (Math.PI/2)) + b; 61 | }, 62 | easeInOutSine: function (x, t, b, c, d) { 63 | return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; 64 | }, 65 | easeInExpo: function (x, t, b, c, d) { 66 | return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; 67 | }, 68 | easeOutExpo: function (x, t, b, c, d) { 69 | return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; 70 | }, 71 | easeInOutExpo: function (x, t, b, c, d) { 72 | if (t==0) return b; 73 | if (t==d) return b+c; 74 | if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; 75 | return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; 76 | }, 77 | easeInCirc: function (x, t, b, c, d) { 78 | return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; 79 | }, 80 | easeOutCirc: function (x, t, b, c, d) { 81 | return c * Math.sqrt(1 - (t=t/d-1)*t) + b; 82 | }, 83 | easeInOutCirc: function (x, t, b, c, d) { 84 | if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; 85 | return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; 86 | }, 87 | easeInElastic: function (x, t, b, c, d) { 88 | var s=1.70158;var p=0;var a=c; 89 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 90 | if (a < Math.abs(c)) { a=c; var s=p/4; } 91 | else var s = p/(2*Math.PI) * Math.asin (c/a); 92 | return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 93 | }, 94 | easeOutElastic: function (x, t, b, c, d) { 95 | var s=1.70158;var p=0;var a=c; 96 | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; 97 | if (a < Math.abs(c)) { a=c; var s=p/4; } 98 | else var s = p/(2*Math.PI) * Math.asin (c/a); 99 | return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; 100 | }, 101 | easeInOutElastic: function (x, t, b, c, d) { 102 | var s=1.70158;var p=0;var a=c; 103 | if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); 104 | if (a < Math.abs(c)) { a=c; var s=p/4; } 105 | else var s = p/(2*Math.PI) * Math.asin (c/a); 106 | if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; 107 | return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; 108 | }, 109 | easeInBack: function (x, t, b, c, d, s) { 110 | if (s == undefined) s = 1.70158; 111 | return c*(t/=d)*t*((s+1)*t - s) + b; 112 | }, 113 | easeOutBack: function (x, t, b, c, d, s) { 114 | if (s == undefined) s = 1.70158; 115 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; 116 | }, 117 | easeInOutBack: function (x, t, b, c, d, s) { 118 | if (s == undefined) s = 1.70158; 119 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 120 | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 121 | }, 122 | easeInBounce: function (x, t, b, c, d) { 123 | return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; 124 | }, 125 | easeOutBounce: function (x, t, b, c, d) { 126 | if ((t/=d) < (1/2.75)) { 127 | return c*(7.5625*t*t) + b; 128 | } else if (t < (2/2.75)) { 129 | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; 130 | } else if (t < (2.5/2.75)) { 131 | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; 132 | } else { 133 | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; 134 | } 135 | }, 136 | easeInOutBounce: function (x, t, b, c, d) { 137 | if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; 138 | return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; 139 | } 140 | }); 141 | 142 | -------------------------------------------------------------------------------- /Public/srsq/styles/js/move-top.js: -------------------------------------------------------------------------------- 1 | /* UItoTop jQuery Plugin 1.2 | Matt Varone | http://www.mattvarone.com/web-design/uitotop-jquery-plugin */ 2 | (function($){$.fn.UItoTop=function(options){var defaults={text:'To Top',min:200,inDelay:600,outDelay:400,containerID:'toTop',containerHoverID:'toTopHover',scrollSpeed:1000,easingType:'linear'},settings=$.extend(defaults,options),containerIDhash='#'+settings.containerID,containerHoverIDHash='#'+settings.containerHoverID;$('body').append(''+settings.text+'');$(containerIDhash).hide().on('click.UItoTop',function(){$('html, body').animate({scrollTop:0},settings.scrollSpeed,settings.easingType);$('#'+settings.containerHoverID,this).stop().animate({'opacity':0},settings.inDelay,settings.easingType);return false;}).prepend('').hover(function(){$(containerHoverIDHash,this).stop().animate({'opacity':1},600,'linear');},function(){$(containerHoverIDHash,this).stop().animate({'opacity':0},700,'linear');});$(window).scroll(function(){var sd=$(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){$(containerIDhash).css({'position':'absolute','top':sd+$(window).height()-50});} 3 | if(sd>settings.min) 4 | $(containerIDhash).fadeIn(settings.inDelay);else 5 | $(containerIDhash).fadeOut(settings.Outdelay);});};})(jQuery); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SRSQ-Vapor 2 | swift vapor服务器demo 私人社区 app后台服务器 3 | 4 | 配套开源移动端项目私人社区iOS 5 | 6 | app地址:https://github.com/cailingyun2010/SRSQ 7 | 8 | App Store https://itunes.apple.com/cn/app/id1127768538 9 | 10 | 简书查看前后端详情使用指南:http://www.jianshu.com/p/9ded3257d97d 11 | -------------------------------------------------------------------------------- /Resources/Views/base.leaf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #import("head") 5 | 6 | 7 | #import("body") 8 | 9 | 10 | -------------------------------------------------------------------------------- /Resources/Views/embeds/header.leaf: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /Resources/Views/home/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 私人社区官网 5 | 6 | 7 | 8 |
9 |

私人社区官网

10 |

11 |
12 | 13 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Resources/Views/share/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 私人社区 12 | 13 | 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 |
22 |
----
23 |
--
24 |
25 |
26 |

27 |
28 |
29 |
30 | 33 | 34 | 35 | 36 | 37 | 197 | 198 | 199 | -------------------------------------------------------------------------------- /Resources/Views/srsq/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 私人社区官网 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 23 | 24 | 25 | 26 | 66 | 67 | 73 | 74 | 75 | 76 | 77 |
78 |
79 |
80 |
81 |

功能介绍

82 |

83 |
84 |
85 |
86 |
87 | 88 |
89 |
90 |

聊天系统

91 |

集成融云RCIM即时通讯聊天服务

92 |
93 |
94 | 95 |
96 |
97 |

安全系统

98 |

采用移动端最流行的第三方登陆,保证用户账号安全

99 |
100 |
101 | 102 |
103 |
104 |

动态发布

105 |

随时随地,发布动态,和好友分享你身边的新鲜事~

106 |
107 |
108 | 109 |
110 |
111 |

网络系统

112 |

采用科技最前沿的swift服务器,云端托管在heroku,24小时为你服务

113 |
114 |
115 | 116 |
117 |
118 |

用户系统

119 |

你可以无需添加好友就可以和你心仪的人聊天,随意畅聊

120 |
121 |
122 |
123 |
124 |
125 | 126 |
127 |
128 |
129 |
130 | 131 | 132 |
133 |
134 |
135 |
136 | 137 |
138 |
139 |

小菜iOS

140 |

私人社区app创始人,同时也是一名iOS开发者,热衷于分享技术,专注移动开发领域

141 |
    142 |
  • 143 |
  • 144 |
  • 145 |
  • 146 |
  • 147 |
148 |
149 |
150 |
151 |
152 |

主要技能,objective-c,swift,html,vapor后台server,微信小程序,目前正在研究leaf语言

153 |
154 |
155 |
156 | 157 | 158 |
159 |
160 |
161 |

私人社区iOS app界面截图

162 |

163 | 目前1.0版本新增功能: 164 | 1.优化即时聊天IM 165 | 2.压缩安装包大小 166 | 3.app极限省流量 167 | 4.支持上传相册 168 | 5.无限制内容分享 169 | 6.动态发布支持连接,点击可调转 170 | 7.社区列表流畅度提升 171 |

172 |
173 |
174 |
175 | 176 |
177 |
178 | 179 |
180 |
181 | 182 |
183 |
184 | 185 |
186 |
187 |
188 |
189 |
190 | 191 | 192 |
193 |
194 |
195 |

app 功能演示

196 |

网站部分功能暂不可用,社长正在紧张建设中,尽请期待

197 |
198 |
199 | 200 |
201 |
202 |
203 | 204 | 205 |
206 |
207 |
208 |

联系我们

209 |

邮箱:625225273@qq.com

210 |

微博:http://weibo.com/u/5100479224

211 |

地址:上海市普陀区曹杨路329号 上海私人社区科技有限公司

212 |
    213 |
  • 214 |
215 | 216 |
217 |
218 |
219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | -------------------------------------------------------------------------------- /Resources/Views/template.leaf: -------------------------------------------------------------------------------- 1 | #embed("embeds/header") 2 | 3 |

#(greeting)

4 | -------------------------------------------------------------------------------- /Resources/Views/welcome.leaf: -------------------------------------------------------------------------------- 1 | #extend("base") 2 | 3 | #export("head") { 4 | My App 5 | 6 | 7 | 8 | } 9 | 10 | #export("body") { 11 |
12 | #raw() { 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | } 23 |

#(message)

24 |
25 | } 26 | -------------------------------------------------------------------------------- /Sources/App/Controllers/PostController.swift: -------------------------------------------------------------------------------- 1 | import Vapor 2 | import HTTP 3 | 4 | final class PostController: ResourceRepresentable { 5 | func index(request: Request) throws -> ResponseRepresentable { 6 | return try Post.all().makeNode().converted(to: JSON.self) 7 | } 8 | 9 | func create(request: Request) throws -> ResponseRepresentable { 10 | var post = try request.post() 11 | try post.save() 12 | return post 13 | } 14 | 15 | func show(request: Request, post: Post) throws -> ResponseRepresentable { 16 | return post 17 | } 18 | 19 | func delete(request: Request, post: Post) throws -> ResponseRepresentable { 20 | try post.delete() 21 | return JSON([:]) 22 | } 23 | 24 | func clear(request: Request) throws -> ResponseRepresentable { 25 | try Post.query().delete() 26 | return JSON([]) 27 | } 28 | 29 | func update(request: Request, post: Post) throws -> ResponseRepresentable { 30 | let new = try request.post() 31 | var post = post 32 | post.content = new.content 33 | try post.save() 34 | return post 35 | } 36 | 37 | func replace(request: Request, post: Post) throws -> ResponseRepresentable { 38 | try post.delete() 39 | return try create(request: request) 40 | } 41 | 42 | func makeResource() -> Resource { 43 | return Resource( 44 | index: index, 45 | store: create, 46 | show: show, 47 | replace: replace, 48 | modify: update, 49 | destroy: delete, 50 | clear: clear 51 | ) 52 | } 53 | } 54 | 55 | extension Request { 56 | func post() throws -> Post { 57 | guard let json = json else { throw Abort.badRequest } 58 | return try Post(node: json) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Sources/App/Models/EBUser.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// EBUser.swift 3 | //// HelloVapor 4 | //// 5 | //// Created by 小菜 on 17/3/22. 6 | //// 7 | //// 8 | // 9 | //import Foundation 10 | //import Vapor 11 | //import Auth 12 | //import HTTP 13 | //import Fluent 14 | //import Turnstile 15 | //import TurnstileCrypto 16 | // 17 | //enum Error: Swift.Error { 18 | // case userNotFound 19 | // case registerNotSupported 20 | // case unsupportedCredentials 21 | //} 22 | // 23 | //final class EBUser: User { 24 | // var id: Node? 25 | // var username: String 26 | // var nickname: String 27 | // var avatar: String 28 | // var password: String 29 | // var exists: Bool = false 30 | // 31 | // init(username: String, nickname: String, avatar: String, password: String) { 32 | // self.username = username 33 | // self.nickname = nickname 34 | // self.avatar = avatar 35 | // self.password = BCrypt.hash(password: password) 36 | // } 37 | // 38 | // init(credentials: UsernamePassword) { 39 | // self.username = credentials.username 40 | // self.password = BCrypt.hash(password: credentials.password) 41 | // self.nickname = "" 42 | // self.avatar = "" 43 | // } 44 | // 45 | // init(node: Node, in context: Context) throws { 46 | // id = try node.extract("id") 47 | // username = try node.extract("username") 48 | // nickname = try node.extract("nickname") 49 | // avatar = try node.extract("avatar") 50 | // password = try node.extract("password") 51 | // } 52 | // 53 | // func makeNode(context: Context) throws -> Node { 54 | // return try Node(node: [ 55 | // "id": id, 56 | // "username": username, 57 | // "nickname": nickname, 58 | // "avatar": avatar, 59 | // "password": password 60 | // ]) 61 | // } 62 | // 63 | // static func prepare(_ database: Database) throws { 64 | // try database.create("ebusers") { users in 65 | // users.id() 66 | // users.string("username") 67 | // users.string("nickname") 68 | // users.string("avatar") 69 | // users.string("password") 70 | // } 71 | // } 72 | // 73 | // static func revert(_ database: Database) throws { 74 | // try database.delete("ebusers") 75 | // } 76 | // 77 | // static func authenticate(credentials: Credentials) throws -> User { 78 | // var user: EBUser? 79 | // switch credentials { 80 | // case let credentials as UsernamePassword: 81 | // let fetchedUser = try EBUser.query() 82 | // .filter("username", credentials.username) 83 | // .first() 84 | // if let password = fetchedUser?.password, 85 | // password != "", 86 | // (try? BCrypt.verify(password: credentials.password, matchesHash: password)) == true { 87 | // user = fetchedUser 88 | // } 89 | // 90 | // default: 91 | // throw UnsupportedCredentialsError() 92 | // } 93 | // 94 | // if let user = user { 95 | // return user 96 | // } else { 97 | // throw IncorrectCredentialsError() 98 | // } 99 | // } 100 | // 101 | // static func register(credentials: Credentials) throws -> Auth.User { 102 | // var user: EBUser 103 | // 104 | // switch credentials { 105 | // case let credentials as UsernamePassword: 106 | // user = EBUser(credentials: credentials) 107 | // default: 108 | // throw UnsupportedCredentialsError() 109 | // } 110 | // if try EBUser.query().filter("username", user.username).first() == nil { 111 | // try user.save() 112 | // return user 113 | // } else { 114 | // throw AccountTakenError() 115 | // } 116 | // } 117 | //} 118 | // 119 | //drop.post("register") { request in 120 | // guard let username = request.data["username"]?.string, 121 | // let password = request.data["password"]?.string else { 122 | // return try drop.view.make("register", ["flash": "Missing username or password"]) 123 | // } 124 | // let credentials = UsernamePassword(username: username, password: password) 125 | // 126 | // do { 127 | // try _ = EBUser.register(credentials: credentials) 128 | // try request.auth.login(credentials) 129 | // return Response(redirect: "/") 130 | // } catch let e as TurnstileError { 131 | // return try drop.view.make("register", Node(node: ["flash": e.description])) 132 | // } 133 | //} 134 | // 135 | //drop.post("login") { request in 136 | // guard let username = request.data["username"]?.string, 137 | // let password = request.data["password"]?.string else { 138 | // return try drop.view.make("login", ["flash": "Missing username or password"]) 139 | // } 140 | // let credentials = UsernamePassword(username: username, password: password) 141 | // do { 142 | // try request.auth.login(credentials) 143 | // return Response(redirect: "/") 144 | // } catch let e { 145 | // return try drop.view.make("login", ["flash": "Invalid username or password"]) 146 | // } 147 | //} 148 | -------------------------------------------------------------------------------- /Sources/App/Models/Post.swift: -------------------------------------------------------------------------------- 1 | import Vapor 2 | import Fluent 3 | import Foundation 4 | 5 | final class Post: Model { 6 | var id: Node? 7 | var content: String 8 | 9 | init(content: String) { 10 | self.id = UUID().uuidString.makeNode() 11 | self.content = content 12 | } 13 | 14 | init(node: Node, in context: Context) throws { 15 | id = try node.extract("id") 16 | content = try node.extract("content") 17 | } 18 | 19 | func makeNode(context: Context) throws -> Node { 20 | return try Node(node: [ 21 | "id": id, 22 | "content": content 23 | ]) 24 | } 25 | } 26 | 27 | extension Post { 28 | /** 29 | This will automatically fetch from database, using example here to load 30 | automatically for example. Remove on real models. 31 | */ 32 | public convenience init?(from string: String) throws { 33 | self.init(content: string) 34 | } 35 | } 36 | 37 | extension Post: Preparation { 38 | static func prepare(_ database: Database) throws { 39 | // 40 | } 41 | 42 | static func revert(_ database: Database) throws { 43 | // 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/App/Models/SQActive.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Vapor 3 | 4 | struct SQActive: Model { 5 | var exists: Bool = false 6 | var id: Node? 7 | 8 | let username: String // 昵称 9 | let sex: String // 性别 10 | let headimgurl: String // 头像 11 | let account: String // 发送人账号 12 | let actcontent: String // 动态内容 限制250字 13 | var zancount: Int // 点赞数 14 | let commoncount: Int // 评论数 15 | let photostr: String // 配图,字符串,用,号切割成数组 16 | let sqlocal: String // 位置 17 | let acttime: String // 动态发送时间 18 | let rcuserid: String 19 | let width: Double 20 | let height: Double 21 | 22 | init(username: String, sex: String, headimgurl: String, account: String, actcontent: String, photostr: String, zancount: Int, commoncount: Int, sqlocal: String, acttime: String,rcuserid: String, width: Double, height: Double) { 23 | self.id = nil 24 | 25 | self.username = username 26 | self.sex = sex 27 | self.headimgurl = headimgurl 28 | 29 | self.account = account 30 | self.actcontent = actcontent 31 | self.zancount = zancount 32 | self.commoncount = commoncount 33 | self.photostr = photostr 34 | self.sqlocal = sqlocal 35 | self.acttime = acttime 36 | 37 | self.rcuserid = rcuserid 38 | 39 | self.width = width; 40 | self.height = height; 41 | } 42 | 43 | init(node: Node, in context: Context) throws { 44 | id = try node.extract("id") 45 | 46 | username = try node.extract("username") 47 | sex = try node.extract("sex") 48 | headimgurl = try node.extract("headimgurl") 49 | 50 | account = try node.extract("account") 51 | actcontent = try node.extract("actcontent") 52 | zancount = try node.extract("zancount") 53 | commoncount = try node.extract("commoncount") 54 | photostr = try node.extract("photostr") 55 | sqlocal = try node.extract("sqlocal") 56 | acttime = try node.extract("acttime") 57 | rcuserid = try node.extract("rcuserid") 58 | 59 | width = try node.extract("width") 60 | height = try node.extract("height") 61 | } 62 | 63 | // Node Represen table 64 | func makeNode(context: Context) throws -> Node { 65 | return try Node(node: ["id": id, 66 | "username": username, 67 | "sex": sex, 68 | "headimgurl": headimgurl, 69 | "account": account, 70 | "actcontent": actcontent, 71 | "zancount": zancount, 72 | "commoncount": commoncount, 73 | "photostr":photostr, 74 | "sqlocal": sqlocal, 75 | "acttime": acttime, 76 | "rcuserid": rcuserid, 77 | "width": width, 78 | "height": height 79 | ]) 80 | } 81 | 82 | // Preparation 83 | static func prepare(_ database: Database) throws { 84 | try database.create("SQActives") { rctokens in 85 | rctokens.id() 86 | rctokens.string("username") 87 | rctokens.string("sex") 88 | rctokens.string("headimgurl") 89 | 90 | rctokens.string("account") 91 | rctokens.string("actcontent") 92 | rctokens.int("zancount") 93 | rctokens.int("commoncount") 94 | rctokens.string("photostr") 95 | rctokens.string("sqlocal") 96 | rctokens.string("acttime") 97 | rctokens.string("rcuserid") 98 | 99 | rctokens.double("width") 100 | rctokens.double("height") 101 | } 102 | } 103 | 104 | static func revert(_ database: Database) throws { 105 | try database.delete("SQActives") 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Sources/App/Models/SQAllUser.swift: -------------------------------------------------------------------------------- 1 | 2 | 3 | import Foundation 4 | import Vapor 5 | 6 | struct SQAllUser: Model { 7 | var exists: Bool = false 8 | var id: Node? 9 | let accesstoken: String 10 | let rctoken: String 11 | 12 | init(accesstoken: String, rctoken: String) { 13 | self.id = nil 14 | self.accesstoken = accesstoken 15 | self.rctoken = rctoken 16 | } 17 | 18 | init(node: Node, in context: Context) throws { 19 | id = try node.extract("id") 20 | accesstoken = try node.extract("accesstoken") 21 | rctoken = try node.extract("rctoken") 22 | } 23 | 24 | // Node Represen table 25 | func makeNode(context: Context) throws -> Node { 26 | return try Node(node: ["id": id, 27 | "accesstoken": accesstoken, 28 | "rctoken": rctoken 29 | ]) 30 | } 31 | 32 | // Preparation 33 | static func prepare(_ database: Database) throws { 34 | try database.create("SQAllUsers") { rctokens in 35 | rctokens.id() 36 | rctokens.string("accesstoken") 37 | rctokens.string("rctoken") 38 | 39 | } 40 | } 41 | 42 | static func revert(_ database: Database) throws { 43 | try database.delete("SQAllUsers") 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Sources/App/Models/SQAnimal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SQAnimal.swift 3 | // HelloVapor 4 | // 5 | // Created by 小菜 on 17/3/10. 6 | // 7 | // 8 | 9 | 10 | import Foundation 11 | import Vapor 12 | 13 | // 动物模型 14 | struct SQAnimal: Model { 15 | var exists: Bool = false 16 | var id: Node? 17 | let dog: String 18 | let cat: String 19 | 20 | let sqperson_id: Int 21 | 22 | init(dog: String, cat: String, sqperson_id: Int) { 23 | self.id = nil 24 | self.dog = dog 25 | self.cat = cat 26 | self.sqperson_id = sqperson_id 27 | } 28 | 29 | init(node: Node, in context: Context) throws { 30 | id = try node.extract("id") 31 | dog = try node.extract("dog") 32 | cat = try node.extract("cat") 33 | sqperson_id = try node.extract("sqperson_id") 34 | } 35 | 36 | // Node Represen table 37 | func makeNode(context: Context) throws -> Node { 38 | return try Node(node: ["id": id, 39 | "dog": dog, 40 | "cat": cat, 41 | "sqperson_id": sqperson_id 42 | ]) 43 | } 44 | 45 | // Preparation 46 | static func prepare(_ database: Database) throws { 47 | try database.create("SQAnimals") { rctokens in 48 | rctokens.id() 49 | rctokens.string("dog") 50 | rctokens.string("cat", length: 10, optional: false, unique: false, default: nil) 51 | rctokens.int("sqperson_id", optional: false, unique: false, default: nil) 52 | } 53 | } 54 | 55 | static func revert(_ database: Database) throws { 56 | try database.delete("SQAnimals") 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Sources/App/Models/SQBanner.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Vapor 3 | 4 | struct SQBanner: Model { 5 | var exists: Bool = false 6 | var id: Node? 7 | 8 | var imgurl: String // 图片地址 9 | let neturl: String // 跳转网页地址 10 | let btype: Int // banner类型: 1.网页。 2.跳与该用户聊天 11 | let squserid: String// btype 为 2 时,该字段有值, 12 | let bannertext: String 13 | 14 | init(imgurl: String, neturl: String, btype: Int, squserid: String, bannertext: String) { 15 | self.id = nil 16 | self.imgurl = imgurl 17 | self.neturl = neturl 18 | self.btype = btype 19 | self.squserid = squserid 20 | self.bannertext = bannertext 21 | } 22 | 23 | init(node: Node, in context: Context) throws { 24 | id = try node.extract("id") 25 | imgurl = try node.extract("imgurl") 26 | neturl = try node.extract("neturl") 27 | btype = try node.extract("btype") 28 | squserid = try node.extract("squserid") 29 | bannertext = try node.extract("bannertext") 30 | } 31 | 32 | // Node Represen table 33 | func makeNode(context: Context) throws -> Node { 34 | return try Node(node: ["id": id, 35 | "imgurl": imgurl, 36 | "neturl": neturl, 37 | "btype": btype, 38 | "squserid": squserid, 39 | "bannertext": bannertext 40 | ]) 41 | } 42 | 43 | // Preparation 44 | static func prepare(_ database: Database) throws { 45 | try database.create("SQBanners") { rctokens in 46 | rctokens.id() 47 | rctokens.string("imgurl") 48 | rctokens.string("neturl") 49 | rctokens.int("btype") 50 | rctokens.string("squserid") 51 | rctokens.string("bannertext") 52 | } 53 | } 54 | 55 | static func revert(_ database: Database) throws { 56 | try database.delete("SQBanners") 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Sources/App/Models/SQFriend.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Vapor 3 | 4 | struct SQFriend: Model { 5 | var exists: Bool = false 6 | var id: Node? 7 | 8 | var username: String 9 | let sex: String 10 | var headimgurl: String 11 | 12 | let rcuserid: String 13 | let deviceno: String 14 | let way: String 15 | let account: String 16 | let pwd: String 17 | var aboutme:String 18 | var zannum: Int 19 | 20 | var photos: String 21 | var tags: String 22 | var activities: String 23 | 24 | // var sqrctoken_id: Int 25 | 26 | init(username: String,sex: String, headimgurl: String, rcuserid: String, deviceno: String, way: String, account: String, pwd: String, aboutme:String, zannum:Int ,photos:String, tags:String, activities: String) { 27 | self.id = nil 28 | self.username = username 29 | self.sex = sex 30 | self.headimgurl = headimgurl 31 | 32 | self.rcuserid = rcuserid 33 | self.deviceno = deviceno 34 | self.way = way 35 | self.account = account 36 | self.pwd = pwd 37 | self.aboutme = aboutme 38 | self.zannum = zannum; 39 | 40 | self.photos = photos; 41 | self.tags = tags; 42 | self.activities = activities; 43 | // self.sqrctoken_id = sqrctoken_id 44 | } 45 | 46 | // Node Initializable 47 | init(node: Node, in context: Context) throws { 48 | id = try node.extract("id") 49 | username = try node.extract("username") 50 | sex = try node.extract("sex") 51 | headimgurl = try node.extract("headimgurl") 52 | 53 | rcuserid = try node.extract("rcuserid") 54 | deviceno = try node.extract("deviceno") 55 | way = try node.extract("way") 56 | account = try node.extract("account") 57 | pwd = try node.extract("pwd") 58 | aboutme = try node.extract("aboutme") 59 | zannum = try node.extract("zannum") 60 | 61 | photos = try node.extract("photos") 62 | tags = try node.extract("tags") 63 | activities = try node.extract("activities") 64 | 65 | // sqrctoken_id = try node.extract("id") 66 | } 67 | 68 | // Node Represen table 69 | func makeNode(context: Context) throws -> Node { 70 | return try Node(node: ["id": id, 71 | "username": username, 72 | "sex": sex, 73 | "headimgurl": headimgurl, 74 | 75 | "rcuserid": rcuserid, 76 | "deviceno": deviceno, 77 | "way": way, 78 | "account": account, 79 | "pwd": pwd, 80 | "aboutme":aboutme, 81 | "zannum":zannum, 82 | 83 | "photos":photos, 84 | "tags":tags, 85 | "activities":activities, 86 | // "sqrctoken_id":sqrctoken_id 87 | ]) 88 | } 89 | 90 | // Preparation 91 | static func prepare(_ database: Database) throws { 92 | try database.create("SQFriends") { friends in 93 | friends.id() 94 | friends.string("username") 95 | friends.string("sex") 96 | friends.string("headimgurl") 97 | 98 | friends.string("rcuserid") 99 | friends.string("deviceno") 100 | friends.string("way") 101 | friends.string("account") 102 | friends.string("pwd") 103 | friends.string("aboutme") 104 | friends.int("zannum") 105 | 106 | friends.string("photos") 107 | friends.string("tags") 108 | friends.string("activities") 109 | 110 | // friends.int("sqrctoken_id") 111 | } 112 | } 113 | 114 | static func revert(_ database: Database) throws { 115 | try database.delete("SQFriends") 116 | } 117 | } 118 | 119 | import Auth 120 | 121 | extension SQFriend: Auth.User { 122 | static func authenticate(credentials: Credentials) throws -> Auth.User { 123 | let user: SQFriend? 124 | 125 | switch credentials { 126 | case let id as Identifier: 127 | user = try SQFriend.find(id.id) 128 | case let accessToken as AccessToken: 129 | user = try SQFriend.query().filter("access_token", accessToken.string).first() 130 | case let apiKey as APIKey: 131 | user = try SQFriend.query().filter("email", apiKey.id).filter("password", apiKey.secret).first() 132 | default: 133 | throw Abort.custom(status: .badRequest, message: "Invalid credentials.") 134 | } 135 | 136 | guard let u = user else { 137 | throw Abort.custom(status: .badRequest, message: "User not found") 138 | } 139 | return u 140 | } 141 | static func register(credentials: Credentials) throws -> Auth.User { 142 | throw Abort.custom(status: .badRequest, message: "Register not supported.") 143 | } 144 | } 145 | 146 | import HTTP 147 | 148 | extension Request { 149 | func user() throws -> SQFriend { 150 | guard let user = try auth.user() as? SQFriend else { 151 | throw Abort.custom(status: .badRequest, message: "Invalid user type.") 152 | } 153 | return user 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /Sources/App/Models/SQPerson.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SQPerson.swift 3 | // HelloVapor 4 | // 5 | // Created by 小菜 on 17/3/10. 6 | // 7 | // 8 | 9 | 10 | import Foundation 11 | import Vapor 12 | 13 | // 人物模型,一个人可以拥有多个宠物 14 | struct SQPerson: Model { 15 | var exists: Bool = false 16 | var id: Node? 17 | let name: String 18 | 19 | init(name: String) { 20 | self.id = nil 21 | self.name = name 22 | } 23 | 24 | init(node: Node, in context: Context) throws { 25 | id = try node.extract("id") 26 | name = try node.extract("name") 27 | } 28 | 29 | // Node Represen table 30 | func makeNode(context: Context) throws -> Node { 31 | return try Node(node: ["id": id, 32 | "name": name 33 | ]) 34 | } 35 | 36 | // Preparation 37 | static func prepare(_ database: Database) throws { 38 | try database.create("SQPersons") { rctokens in 39 | rctokens.id() 40 | rctokens.string("name") 41 | 42 | } 43 | } 44 | 45 | static func revert(_ database: Database) throws { 46 | try database.delete("SQPersons") 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Sources/App/Models/SQPic.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import Vapor 4 | 5 | struct SQPic: Model { 6 | var exists: Bool = false 7 | var id: Node? 8 | let pic: String 9 | 10 | init(pic: String) { 11 | self.id = nil 12 | self.pic = pic 13 | } 14 | 15 | init(node: Node, in context: Context) throws { 16 | id = try node.extract("id") 17 | pic = try node.extract("pic") 18 | } 19 | 20 | // Node Represen table 21 | func makeNode(context: Context) throws -> Node { 22 | return try Node(node: ["id": id, 23 | "pic": pic 24 | ]) 25 | } 26 | 27 | // Preparation 28 | static func prepare(_ database: Database) throws { 29 | try database.create("SQPics") { rctokens in 30 | rctokens.id() 31 | rctokens.string("pic") 32 | 33 | } 34 | } 35 | 36 | static func revert(_ database: Database) throws { 37 | try database.delete("SQPics") 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Sources/App/Models/SQProfile.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Vapor 3 | 4 | struct SQProfile: Model { 5 | var exists: Bool = false 6 | var id: Node? 7 | let accesstoken: String 8 | let rctoken: String 9 | 10 | init(accesstoken: String, rctoken: String) { 11 | self.id = nil 12 | self.accesstoken = accesstoken 13 | self.rctoken = rctoken 14 | } 15 | 16 | init(node: Node, in context: Context) throws { 17 | id = try node.extract("id") 18 | accesstoken = try node.extract("accesstoken") 19 | rctoken = try node.extract("rctoken") 20 | } 21 | 22 | // Node Represen table 23 | func makeNode(context: Context) throws -> Node { 24 | return try Node(node: ["id": id, 25 | "accesstoken": accesstoken, 26 | "rctoken": rctoken 27 | ]) 28 | } 29 | 30 | // Preparation 31 | static func prepare(_ database: Database) throws { 32 | try database.create("SQProfiles") { rctokens in 33 | rctokens.id() 34 | rctokens.string("accesstoken") 35 | rctokens.string("rctoken") 36 | 37 | } 38 | } 39 | 40 | static func revert(_ database: Database) throws { 41 | try database.delete("SQProfiles") 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Sources/App/Models/SQRcToken.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Vapor 3 | 4 | struct SQRcToken: Model { 5 | var exists: Bool = false 6 | var id: Node? 7 | 8 | let account: String 9 | let token: String 10 | let openid: String 11 | var rctoken: String 12 | 13 | init(account:String,token:String, openid:String, rctoken: String) { 14 | self.id = nil 15 | 16 | self.account = account 17 | self.token = token 18 | self.openid = openid 19 | self.rctoken = rctoken 20 | } 21 | 22 | init(node: Node, in context: Context) throws { 23 | id = try node.extract("id") 24 | account = try node.extract("account") 25 | token = try node.extract("token") 26 | rctoken = try node.extract("rctoken") 27 | openid = try node.extract("openid") 28 | } 29 | 30 | // Node Represen table 31 | func makeNode(context: Context) throws -> Node { 32 | return try Node(node: ["id": id, 33 | "account": account, 34 | "token": token, 35 | "openid": openid, 36 | "rctoken": rctoken, 37 | ]) 38 | } 39 | 40 | // Preparation 41 | static func prepare(_ database: Database) throws { 42 | try database.create("SQRcTokens") { rctokens in 43 | rctokens.id() 44 | rctokens.string("account") 45 | rctokens.string("token") 46 | rctokens.string("openid") 47 | rctokens.string("rctoken") 48 | } 49 | } 50 | 51 | static func revert(_ database: Database) throws { 52 | try database.delete("SQRcTokens") 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Sources/App/Models/UInt32+Random.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UInt32+Random.swift 3 | // HelloVapor 4 | // 5 | // Created by 小菜 on 17/2/27. 6 | // 7 | // 8 | import libc 9 | 10 | extension UInt32 { 11 | static func random() -> UInt32 { 12 | let max = UInt32.max 13 | #if os(Linux) 14 | let val = UInt32(libc.random() % Int(max)) 15 | #else 16 | let val = UInt32(arc4random_uniform(max)) 17 | #endif 18 | return val 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Sources/App/main.swift: -------------------------------------------------------------------------------- 1 | import Vapor 2 | import VaporPostgreSQL 3 | import HTTP 4 | import Auth 5 | import TurnstileCrypto 6 | import Foundation 7 | 8 | // MARK: - 0.初始化 9 | 10 | let drop = Droplet() 11 | let auth = AuthMiddleware(user:SQFriend.self) 12 | drop.middleware.append(auth) 13 | do { 14 | try drop.addProvider(VaporPostgreSQL.Provider.self) 15 | } catch { 16 | print("Error adding provider: \(error)") 17 | } 18 | drop.preparations = [SQFriend.self,SQRcToken.self,SQAllUser.self,SQProfile.self,SQActive.self,SQBanner.self,SQPic.self,SQPerson.self,SQAnimal.self] 19 | 20 | drop.get { req in 21 | return try drop.view.make("welcome", [ 22 | "message": drop.localization[req.lang, "welcome", "title"] ]) 23 | } 24 | 25 | // MARK: - 1.朋友 第三方登陆 API 26 | drop.group("friends") { friends in 27 | 28 | // MARK: - 1.1 如果该用户已经登陆过,可以从cookie中获取用户信息 29 | let protect = ProtectMiddleware(error: 30 | Abort.custom(status: .forbidden, message: "Not authorized.") 31 | ) 32 | friends.group(protect) { secure in 33 | secure.get("secure") { req in 34 | 35 | let haveFriend = try req.user() 36 | let rc = try SQRcToken.query().filter("account",haveFriend.account).first() 37 | return try JSON(node: [ 38 | "result" : "0", 39 | "token":rc!.token, 40 | "rctoken":rc!.rctoken, 41 | "data": haveFriend.makeJSON() 42 | ]) 43 | } 44 | } 45 | 46 | friends.post("friendLogin") { req in 47 | 48 | guard let openid = req.data["openid"]?.string else { 49 | throw Abort.badRequest 50 | } 51 | let rc = try SQRcToken.query().filter("openid",openid).first() 52 | if rc != nil { // 用户直接登陆 53 | let haveFriend = try SQFriend.query().filter("account",rc!.account).first() 54 | // let creds = Identifier(id: (haveFriend?.id)!) // 缓存用户登录信息,下次直接从cookie获取 55 | // try req.auth.login(creds) 56 | 57 | return try JSON(node: [ 58 | "result" : "0", 59 | "token":rc!.token, 60 | "rctoken":rc!.rctoken, 61 | "data": haveFriend!.makeJSON() 62 | ]) 63 | } else { 64 | // 用户不存在,创建用户 65 | return try JSON(node: [ 66 | "result" : "4040", 67 | ]) 68 | } 69 | } 70 | // 保存融云token 接口 71 | friends.post("rctoken") { req in 72 | guard let username = req.data["username"]?.string else { 73 | throw Abort.badRequest 74 | } 75 | guard let sex = req.data["sex"]?.string else { 76 | throw Abort.badRequest 77 | } 78 | guard let headimgurl = req.data["headimgurl"]?.string else { 79 | throw Abort.badRequest 80 | } 81 | guard let openid = req.data["openid"]?.string else { 82 | throw Abort.badRequest 83 | } 84 | guard let deviceno = req.data["deviceno"]?.string else { 85 | throw Abort.badRequest 86 | } 87 | guard let way = req.data["way"]?.string else { 88 | throw Abort.badRequest 89 | } 90 | guard let rctoken = req.data["rctoken"]?.string else { 91 | throw Abort.badRequest 92 | } 93 | guard let rcuserid = req.data["rcuserid"]?.string else { 94 | throw Abort.badRequest 95 | } 96 | 97 | // =================================== 条件限制 =================================== // 98 | let haveRc = try SQRcToken.query().filter("openid",openid).first() 99 | if haveRc != nil { // 已经存在 100 | return try JSON(node: [ 101 | "result" : "4000", 102 | ]) 103 | } 104 | let allF = try SQFriend.query().filter("deviceno",deviceno).all() 105 | if allF.count >= 10 { 106 | return try JSON(node: [ 107 | "result" : "4000", 108 | ]) 109 | } 110 | // =================================== 条件限制 =================================== // 111 | 112 | // 生成账号 113 | var acc_date = Date().timeIntervalSince1970*100 114 | let acc_tempTimeStr = String(format: "%.f", acc_date) 115 | let account_RandStr = URandom().secureToken 116 | let account = way + acc_tempTimeStr + account_RandStr 117 | 118 | // 生成token 119 | var date = Date().timeIntervalSince1970*100 120 | let tempTimeStr = String(format: "%.f", date) 121 | let randStr = URandom().secureToken 122 | let token = tempTimeStr + randStr 123 | 124 | var friend = SQFriend(username: username,sex:sex, headimgurl: headimgurl,rcuserid:rcuserid, deviceno: deviceno, way: way, account: account, pwd:"", aboutme:"", zannum:0, photos:"",tags:"", activities:"") 125 | try friend.save() 126 | 127 | var rc = SQRcToken(account:account, token:token, openid:openid, rctoken: rctoken) 128 | try rc.save() 129 | 130 | return try JSON(node: [ 131 | "result" : "0", 132 | "token":rc.token, 133 | "rctoken":rc.rctoken, 134 | "data": friend.makeJSON() 135 | ]) 136 | } 137 | // 所有用户赞 接口 138 | friends.post("zan") { req in 139 | guard let rcuserid = req.data["rcuserid"]?.string else { 140 | throw Abort.badRequest 141 | } 142 | var friend = try SQFriend.query().filter("rcuserid", rcuserid).first() 143 | friend?.zannum += 1 144 | try friend?.save() 145 | return try JSON(node: [ 146 | "result" : "0", 147 | ]) 148 | } 149 | } 150 | // MARK: - 2.个人资料 151 | drop.group("user") { user in 152 | 153 | // 查询个人中心资料 154 | user.post("profile") { req in 155 | guard let account = req.data["account"]?.string else { 156 | throw Abort.badRequest 157 | } 158 | var friend = try SQFriend.query().filter("account", account).first() 159 | if friend != nil { 160 | return try JSON(node: [ 161 | "result" : "0", 162 | "data":JSON(node: friend!.makeJSON()) 163 | ]) 164 | } else { 165 | return try JSON(node: [ 166 | "result" : "1", 167 | ]) 168 | } 169 | } 170 | 171 | // 更新个人中心资料 172 | user.post("updateNick") { req in 173 | guard let account = req.data["account"]?.string else { 174 | throw Abort.badRequest 175 | } 176 | guard let token = req.data["token"]?.string else { 177 | throw Abort.badRequest 178 | } 179 | guard let username = req.data["username"]?.string else { 180 | throw Abort.badRequest 181 | } 182 | 183 | var friend = try SQFriend.query().filter("account", account).first() 184 | if friend != nil { 185 | var rcModel = try SQRcToken.query().filter("token", token).first() 186 | if rcModel != nil { 187 | if (rcModel?.token.equals(any: token))! { 188 | friend?.username = username 189 | try friend?.save() 190 | return try JSON(node: [ 191 | "result" : "0", 192 | ]) 193 | } else { 194 | return try JSON(node: [ 195 | "result" : "1", 196 | ]) 197 | } 198 | } else { 199 | return try JSON(node: [ 200 | "result" : "1", 201 | ]) 202 | } 203 | } else { 204 | return try JSON(node: [ 205 | "result" : "1", 206 | ]) 207 | } 208 | } 209 | 210 | user.post("updateAboutMe") { req in 211 | guard let account = req.data["account"]?.string else { 212 | throw Abort.badRequest 213 | } 214 | guard let token = req.data["token"]?.string else { 215 | throw Abort.badRequest 216 | } 217 | guard let aboutme = req.data["aboutme"]?.string else { 218 | throw Abort.badRequest 219 | } 220 | 221 | var friend = try SQFriend.query().filter("account", account).first() 222 | if friend != nil { 223 | var rcModel = try SQRcToken.query().filter("token", token).first() 224 | if rcModel != nil { 225 | if (rcModel?.token.equals(any: token))! { 226 | friend?.aboutme = aboutme 227 | try friend?.save() 228 | return try JSON(node: [ 229 | "result" : "0", 230 | ]) 231 | } else { 232 | return try JSON(node: [ 233 | "result" : "1", 234 | ]) 235 | } 236 | } else { 237 | return try JSON(node: [ 238 | "result" : "1", 239 | ]) 240 | } 241 | } else { 242 | return try JSON(node: [ 243 | "result" : "1", 244 | ]) 245 | } 246 | } 247 | user.post("updateTags") { req in 248 | guard let account = req.data["account"]?.string else { 249 | throw Abort.badRequest 250 | } 251 | guard let token = req.data["token"]?.string else { 252 | throw Abort.badRequest 253 | } 254 | guard let tags = req.data["tags"]?.string else { 255 | throw Abort.badRequest 256 | } 257 | 258 | var friend = try SQFriend.query().filter("account", account).first() 259 | if friend != nil { 260 | var rcModel = try SQRcToken.query().filter("token", token).first() 261 | if rcModel != nil { 262 | if (rcModel?.token.equals(any: token))! { 263 | friend?.tags = tags 264 | try friend?.save() 265 | return try JSON(node: [ 266 | "result" : "0", 267 | ]) 268 | } else { 269 | return try JSON(node: [ 270 | "result" : "1", 271 | ]) 272 | } 273 | } else { 274 | return try JSON(node: [ 275 | "result" : "1", 276 | ]) 277 | } 278 | } else { 279 | return try JSON(node: [ 280 | "result" : "1", 281 | ]) 282 | } 283 | } 284 | user.post("updatePhotos") { req in 285 | guard let account = req.data["account"]?.string else { 286 | throw Abort.badRequest 287 | } 288 | guard let token = req.data["token"]?.string else { 289 | throw Abort.badRequest 290 | } 291 | guard let photos = req.data["photos"]?.string else { 292 | throw Abort.badRequest 293 | } 294 | 295 | var friend = try SQFriend.query().filter("account", account).first() 296 | if friend != nil { 297 | var rcModel = try SQRcToken.query().filter("token", token).first() 298 | if rcModel != nil { 299 | if (rcModel?.token.equals(any: token))! { 300 | friend?.photos = photos 301 | try friend?.save() 302 | return try JSON(node: [ 303 | "result" : "0", 304 | "photos" : photos 305 | ]) 306 | } else { 307 | return try JSON(node: [ 308 | "result" : "1", 309 | ]) 310 | } 311 | } else { 312 | return try JSON(node: [ 313 | "result" : "1", 314 | ]) 315 | } 316 | } else { 317 | return try JSON(node: [ 318 | "result" : "1", 319 | ]) 320 | } 321 | } 322 | user.post("updateHeaderImage") { req in 323 | guard let account = req.data["account"]?.string else { 324 | throw Abort.badRequest 325 | } 326 | guard let token = req.data["token"]?.string else { 327 | throw Abort.badRequest 328 | } 329 | guard let headimgurl = req.data["headimgurl"]?.string else { 330 | throw Abort.badRequest 331 | } 332 | var friend = try SQFriend.query().filter("account", account).first() 333 | if friend != nil { 334 | var rcModel = try SQRcToken.query().filter("token", token).first() 335 | if rcModel != nil { 336 | if (rcModel?.token.equals(any: token))! { 337 | friend?.headimgurl = headimgurl 338 | try friend?.save() 339 | return try JSON(node: [ 340 | "result" : "0", 341 | "headimgurl" : headimgurl 342 | ]) 343 | } else { 344 | return try JSON(node: [ 345 | "result" : "1", 346 | ]) 347 | } 348 | } else { 349 | return try JSON(node: [ 350 | "result" : "1", 351 | ]) 352 | } 353 | } else { 354 | return try JSON(node: [ 355 | "result" : "1", 356 | ]) 357 | } 358 | } 359 | } 360 | // MARK: - 3.广场 API 361 | drop.group("allUsers") { allUsers in 362 | allUsers.get("allFriends") { req in 363 | let friends = try SQFriend.all() 364 | let sqpic = try SQPic.all().first 365 | return try JSON(node: [ 366 | "result" : "0", 367 | "data" : JSON(node: friends.makeJSON()), 368 | "pic" : sqpic?.pic, 369 | "color" : "FC6E5E" 370 | ]) 371 | } 372 | } 373 | 374 | // MARK: - 4.banner API 375 | drop.group("sqbanner") { sqbanner in 376 | sqbanner.get("banner") { req in 377 | return try JSON(node: SQBanner.all().makeJSON()) 378 | } 379 | // 新增banner条 380 | sqbanner.post("addbanner") { req in 381 | guard let imgurl = req.data["imgurl"]?.string else { 382 | throw Abort.badRequest 383 | } 384 | guard let neturl = req.data["neturl"]?.string else { 385 | throw Abort.badRequest 386 | } 387 | guard let btype = req.data["btype"]?.int else { 388 | throw Abort.badRequest 389 | } 390 | guard let squserid = req.data["squserid"]?.string else { 391 | throw Abort.badRequest 392 | } 393 | guard let bannertext = req.data["bannertext"]?.string else { 394 | throw Abort.badRequest 395 | } 396 | 397 | var banner = SQBanner(imgurl: imgurl, neturl: neturl, btype: btype, squserid: squserid, bannertext: bannertext) 398 | try banner.save() 399 | return try JSON(node: [ 400 | "result" : "0" 401 | ]) 402 | } 403 | 404 | sqbanner.post("sqpic") { rep in 405 | guard let pic = rep.data["pic"]?.string else { 406 | throw Abort.badRequest 407 | } 408 | var sqpic = SQPic(pic: pic) 409 | try sqpic.save() 410 | return try JSON(node: [ 411 | "result" : "0" 412 | ]) 413 | } 414 | } 415 | 416 | // MARK: - 5.动态 API 417 | drop.group("sqacitves") { sqacitves in 418 | 419 | sqacitves.post("act") { req in 420 | guard let page = req.data["page"]?.int else { 421 | throw Abort.badRequest 422 | } 423 | return try JSON(node: [ 424 | "result" : "0", 425 | "data" : JSON(node: SQActive.all().makeJSON()), 426 | "haveMore":"Y" 427 | ]) 428 | } 429 | sqacitves.post("release") { req in 430 | 431 | guard let username = req.data["username"]?.string else { 432 | throw Abort.badRequest 433 | } 434 | guard let sex = req.data["sex"]?.string else { 435 | throw Abort.badRequest 436 | } 437 | guard let headimgurl = req.data["headimgurl"]?.string else { 438 | throw Abort.badRequest 439 | } 440 | guard let account = req.data["account"]?.string else { 441 | throw Abort.badRequest 442 | } 443 | guard let token = req.data["token"]?.string else { 444 | throw Abort.badRequest 445 | } 446 | guard let actcontent = req.data["actcontent"]?.string else { 447 | throw Abort.badRequest 448 | } 449 | guard let zancount = req.data["zancount"]?.int else { 450 | throw Abort.badRequest 451 | } 452 | guard let commoncount = req.data["commoncount"]?.int else { 453 | throw Abort.badRequest 454 | } 455 | guard let photostr = req.data["photostr"]?.string else { 456 | throw Abort.badRequest 457 | } 458 | guard let sqlocal = req.data["sqlocal"]?.string else { 459 | throw Abort.badRequest 460 | } 461 | guard let acttime = req.data["acttime"]?.string else { 462 | throw Abort.badRequest 463 | } 464 | guard let rcuserid = req.data["rcuserid"]?.string else { 465 | throw Abort.badRequest 466 | } 467 | guard let width = req.data["width"]?.double else { 468 | throw Abort.badRequest 469 | } 470 | guard let height = req.data["height"]?.double else { 471 | throw Abort.badRequest 472 | } 473 | 474 | var rcToken = try SQRcToken.query().filter("account", account).first() 475 | if (rcToken?.token.equals(any: token))! { 476 | var act = SQActive(username: username, sex: sex, headimgurl: headimgurl, account: account, actcontent: actcontent, photostr: photostr, zancount: zancount, commoncount: commoncount, sqlocal: sqlocal, acttime: acttime, rcuserid: rcuserid, width: width, height: height) 477 | try act.save() 478 | 479 | var fri = try SQFriend.query().filter("account", account).first() 480 | if (fri?.activities.equals(any: ""))! { 481 | fri?.activities = acttime 482 | } else { 483 | fri?.activities = (fri?.activities)! + "," + acttime 484 | } 485 | try fri?.save() 486 | return try JSON(node: [ 487 | "result" : "0", 488 | "data" : JSON(node: act.makeJSON()) 489 | ]) 490 | } else { 491 | return try JSON(node: [ 492 | "result" : "1", 493 | ]) 494 | } 495 | } 496 | sqacitves.post("zan") { req in 497 | guard let id = req.data["id"]?.string else { 498 | throw Abort.badRequest 499 | } 500 | var act = try SQActive.query().filter("id", id).first() 501 | act?.zancount += 1 502 | try act?.save() 503 | return try JSON(node: [ 504 | "result" : "0", 505 | ]) 506 | } 507 | } 508 | // MARK: - 6.Apple 专用 509 | drop.group("apple") { apple in 510 | apple.post("login") { req in 511 | guard let account = req.data["account"]?.string else { 512 | throw Abort.badRequest 513 | } 514 | guard let pwd = req.data["pwd"]?.string else { 515 | throw Abort.badRequest 516 | } 517 | if account.equals(any: "123456789") && pwd.equals(any: "123654") { 518 | let haveFriend = try SQFriend.query().filter("id", 1).first() 519 | let rc = try SQRcToken.query().filter("account", (haveFriend?.account)!).first() 520 | return try JSON(node: [ 521 | "result" : "0", 522 | "token":rc!.token, 523 | "rctoken":rc!.rctoken, 524 | "data": haveFriend!.makeJSON() 525 | ]) 526 | } 527 | let f = try SQFriend.query().filter("name",.greaterThan, 21).all() 528 | 529 | let haveFriend = try SQFriend.query().filter("pwd", "123").first() 530 | let rc = try SQRcToken.query().filter("account", (haveFriend?.account)!).first() 531 | return try JSON(node: [ 532 | "result" : "1" 533 | ]) 534 | } 535 | } 536 | 537 | // MARK: - 7.网页接口 538 | drop.get("/srsq") { request in 539 | let dict = request.json 540 | return try drop.view.make("srsq/index.html") 541 | } 542 | drop.get("/home") { request in 543 | 544 | let id = request.data["id"]?.int 545 | if id != nil { 546 | return try JSON(node: [ 547 | "result" : "1", 548 | "data":JSON(node: SQActive.find(id!)?.makeJSON()) 549 | ]) 550 | } 551 | return try drop.view.make("home/welcome.html") 552 | } 553 | drop.get("shareData") { request in 554 | guard let id = request.data["id"]?.string else { 555 | throw Abort.badRequest 556 | } 557 | var act = try SQActive.find(id) 558 | if act != nil { 559 | return try JSON(node: [ 560 | "result" : "0", 561 | "data":JSON(node: act?.makeJSON()) 562 | ]) 563 | } else { 564 | return try JSON(node: [ 565 | "result" : "1", 566 | ]) 567 | } 568 | } 569 | drop.get("profileShare") { request in 570 | guard let account = request.data["id"]?.string else { 571 | throw Abort.badRequest 572 | } 573 | var act = try SQFriend.query().filter("account", account).first(); 574 | if act != nil { 575 | return try JSON(node: [ 576 | "result" : "0", 577 | "data":JSON(node: act?.makeJSON()) 578 | ]) 579 | } else { 580 | return try JSON(node: [ 581 | "result" : "1", 582 | ]) 583 | } 584 | } 585 | drop.get("/share") { request in 586 | return try drop.view.make("share/index.html") 587 | } 588 | // MARK: - 8.1 版本更新 589 | drop.post("version") { request in 590 | 591 | guard let version = request.data["version"]?.string else { 592 | throw Abort.badRequest 593 | } 594 | if version.equals(any: "1.5.0") { 595 | return try JSON(node: [ 596 | "result": "0", 597 | "msg": "0" 598 | ]) 599 | } else { 600 | return try JSON(node: [ 601 | "result": "1", 602 | "msg": "发现新版:1.3.0,更新内容:\n1.优化即时聊天IM\n2.压缩安装包大小\n3.极限省流量\n4.支持上传相册\n5.无限制内容分享\n6.动态发布支持连接,点击可调转\n7.社区列表流畅度提升\n8.支持https\n9.消息推送、自定义推送\n10.安全的cookie自动登录策略" 603 | ]) 604 | } 605 | } 606 | // MARK: - 8.2 安全策略 607 | drop.post("cysafee") { request in 608 | guard let v = request.data["v"]?.string else { 609 | throw Abort.badRequest 610 | } 611 | guard let c = request.data["c"]?.int else { 612 | throw Abort.badRequest 613 | } 614 | return try JSON(node: [ 615 | "l": "111", 616 | "s": "1", 617 | "c": "0", 618 | ]) 619 | } 620 | 621 | // MARK: - 9.1 演示 API 622 | drop.get("leaf") { request in 623 | return try drop.view.make("template", [ 624 | "greeting": "Hello, world!" 625 | ]) 626 | } 627 | drop.get("session") { request in 628 | let json = try JSON(node: [ 629 | "session.data": "\(request.session().data["name"])", 630 | "request.cookies": "\(request.cookies)", 631 | "instructions": "Refresh to see cookie and session get set." 632 | ]) 633 | var response = try Response(status: .ok, json: json) 634 | try request.session().data["name"] = "Vapor" 635 | response.cookies["test"] = "123" 636 | 637 | return response 638 | } 639 | drop.get("data", Int.self) { request, int in 640 | return try JSON(node: [ 641 | "int": int, 642 | "name": request.data["name"]?.string ?? "no name" 643 | ]) 644 | } 645 | drop.get("json") { request in 646 | return try JSON(node: [ 647 | "number": 123, 648 | "string": "test", 649 | "array": try JSON(node: [ 650 | 0, 1, 2, 3 651 | ]), 652 | "dict": try JSON(node: [ 653 | "name": "Vapor", 654 | "lang": "Swift" 655 | ]) 656 | ]) 657 | } 658 | 659 | // MARK: - 10 待调查 660 | // 1.cookie 时长 661 | 662 | drop.resource("posts", PostController()) 663 | drop.run() 664 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "VaporApp", 3 | "scripts": {}, 4 | "env": {}, 5 | "formation": {}, 6 | "addons": [], 7 | "buildpacks": [ 8 | { 9 | "url": "https://github.com/vapor/heroku-buildpack" 10 | } 11 | ] 12 | } 13 | --------------------------------------------------------------------------------