├── book
└── src
│ ├── main
│ ├── paradox
│ │ ├── directives
│ │ │ ├── cookie.md
│ │ │ ├── file.md
│ │ │ ├── method.md
│ │ │ ├── marshalling.md
│ │ │ ├── parameter_form.md
│ │ │ └── index.md
│ │ ├── oauth
│ │ │ ├── oauth.z.md
│ │ │ ├── oauth.3.md
│ │ │ ├── index.md
│ │ │ └── oauth.1.md
│ │ ├── data
│ │ │ ├── data.z.md
│ │ │ ├── data.0.md
│ │ │ ├── data.2.md
│ │ │ ├── index.md
│ │ │ └── data.kryo.md
│ │ ├── test
│ │ │ ├── test.2.md
│ │ │ ├── test.z.md
│ │ │ ├── test.0.md
│ │ │ └── index.md
│ │ ├── appendix
│ │ │ ├── appendix.2.md
│ │ │ ├── appendix.1.md
│ │ │ ├── index.md
│ │ │ └── appendix.0.md
│ │ ├── config-discovery
│ │ │ └── index.md
│ │ ├── database
│ │ │ ├── database.z.md
│ │ │ ├── database.2.md
│ │ │ ├── database.0.md
│ │ │ └── index.md
│ │ ├── scala
│ │ │ ├── scala.7.md
│ │ │ ├── scala.z.md
│ │ │ ├── index.md
│ │ │ ├── scala.1.md
│ │ │ └── scala.0.md
│ │ ├── routing-dsl
│ │ │ ├── exception.md
│ │ │ ├── rejections.md
│ │ │ └── index.md
│ │ ├── engineering
│ │ │ ├── swagger.md
│ │ │ └── index.md
│ │ ├── basic
│ │ │ ├── basic.z.md
│ │ │ ├── index.md
│ │ │ └── basic.1.md
│ │ ├── actor
│ │ │ ├── actor-test.md
│ │ │ ├── actor.z.md
│ │ │ └── index.md
│ │ ├── assets
│ │ │ └── imgs
│ │ │ │ ├── 01.2.1.png
│ │ │ │ ├── 01.2.2.png
│ │ │ │ ├── 01.1.runMain.png
│ │ │ │ ├── wepay-qrcode.jpg
│ │ │ │ ├── 01.1.testOnly.png
│ │ │ │ ├── CassandraTable.png
│ │ │ │ ├── alipay-qrcode.jpg
│ │ │ │ ├── account-center-01.png
│ │ │ │ ├── akka-http-packages.png
│ │ │ │ ├── ant-design-pro-500.png
│ │ │ │ ├── json
│ │ │ │ └── JacksonSupportTest.png
│ │ │ │ ├── testOnly-UserRepositoryTest.png
│ │ │ │ ├── testOnly-AuthorRepositoryTest.png
│ │ │ │ ├── basic-web-server-request-steps.png
│ │ │ │ └── qrcode_for_gh_70b815e4a7cd_344.jpg
│ │ ├── env
│ │ │ ├── env.z.md
│ │ │ ├── index.md
│ │ │ └── env.2.md
│ │ ├── server-api
│ │ │ ├── index.md
│ │ │ └── advanced.md
│ │ ├── donate.md
│ │ ├── index.md
│ │ └── examples
│ │ │ └── example.md
│ └── scala
│ │ └── ws.sc
│ └── test
│ ├── resources
│ └── logback-test.xml
│ └── scala
│ └── book
│ └── custom
│ └── directive
│ └── CustomDirectiveTest.scala
├── project
├── build.properties
└── Common.scala
├── ant-design-pro
├── web
│ ├── .eslintignore
│ ├── .firebaserc
│ ├── jest.config.js
│ ├── src
│ │ ├── components
│ │ │ ├── Charts
│ │ │ │ ├── TimelineChart
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── bizcharts.d.ts
│ │ │ │ ├── bizcharts.js
│ │ │ │ ├── TagCloud
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── Field
│ │ │ │ │ ├── index.d.ts
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── index.less
│ │ │ │ ├── demo
│ │ │ │ │ ├── mini-progress.md
│ │ │ │ │ ├── gauge.md
│ │ │ │ │ ├── mini-pie.md
│ │ │ │ │ ├── waterwave.md
│ │ │ │ │ ├── bar.md
│ │ │ │ │ ├── tag-cloud.md
│ │ │ │ │ ├── mini-area.md
│ │ │ │ │ ├── mini-bar.md
│ │ │ │ │ ├── timeline-chart.md
│ │ │ │ │ └── pie.md
│ │ │ │ ├── g2.js
│ │ │ │ ├── WaterWave
│ │ │ │ │ ├── index.d.ts
│ │ │ │ │ └── index.less
│ │ │ │ ├── Gauge
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── MiniProgress
│ │ │ │ │ ├── index.d.ts
│ │ │ │ │ ├── index.less
│ │ │ │ │ └── index.js
│ │ │ │ ├── MiniBar
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── index.less
│ │ │ │ ├── Bar
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── Radar
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── ChartCard
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── MiniArea
│ │ │ │ │ └── index.d.ts
│ │ │ │ ├── Pie
│ │ │ │ │ └── index.d.ts
│ │ │ │ └── index.d.ts
│ │ │ ├── Login
│ │ │ │ ├── loginContext.js
│ │ │ │ ├── LoginSubmit.js
│ │ │ │ ├── index.less
│ │ │ │ └── LoginTab.js
│ │ │ ├── DescriptionList
│ │ │ │ ├── responsive.js
│ │ │ │ ├── index.js
│ │ │ │ ├── Description.d.ts
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── Description.js
│ │ │ │ └── DescriptionList.js
│ │ │ ├── PageHeaderWrapper
│ │ │ │ ├── GridContent.less
│ │ │ │ ├── index.less
│ │ │ │ └── GridContent.js
│ │ │ ├── NoticeIcon
│ │ │ │ ├── demo
│ │ │ │ │ └── basic.md
│ │ │ │ ├── index.less
│ │ │ │ ├── NoticeIconTab.d.ts
│ │ │ │ └── index.d.ts
│ │ │ ├── FooterToolbar
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.zh-CN.md
│ │ │ │ ├── index.en-US.md
│ │ │ │ └── index.less
│ │ │ ├── StandardTable
│ │ │ │ └── index.less
│ │ │ ├── TagSelect
│ │ │ │ ├── TagSelectOption.d.ts
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.less
│ │ │ │ ├── demo
│ │ │ │ │ └── simple.md
│ │ │ │ └── index.md
│ │ │ ├── PageHeader
│ │ │ │ ├── breadcrumb.d.ts
│ │ │ │ ├── demo
│ │ │ │ │ └── simple.md
│ │ │ │ └── index.d.ts
│ │ │ ├── SelectLang
│ │ │ │ └── index.less
│ │ │ ├── Trend
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── demo
│ │ │ │ │ ├── basic.md
│ │ │ │ │ └── reverse.md
│ │ │ │ ├── index.md
│ │ │ │ ├── index.less
│ │ │ │ └── index.js
│ │ │ ├── CountDown
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.zh-CN.md
│ │ │ │ ├── index.en-US.md
│ │ │ │ └── demo
│ │ │ │ │ └── simple.md
│ │ │ ├── Authorized
│ │ │ │ ├── Authorized.js
│ │ │ │ ├── index.js
│ │ │ │ ├── demo
│ │ │ │ │ ├── basic.md
│ │ │ │ │ ├── secured.md
│ │ │ │ │ ├── AuthorizedArray.md
│ │ │ │ │ └── AuthorizedFunction.md
│ │ │ │ ├── AuthorizedRoute.js
│ │ │ │ └── renderAuthorize.js
│ │ │ ├── AvatarList
│ │ │ │ ├── AvatarItem.d.ts
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── demo
│ │ │ │ │ └── simple.md
│ │ │ │ ├── index.zh-CN.md
│ │ │ │ ├── index.en-US.md
│ │ │ │ └── index.less
│ │ │ ├── _utils
│ │ │ │ ├── pathTools.js
│ │ │ │ └── pathTools.test.js
│ │ │ ├── Exception
│ │ │ │ ├── demo
│ │ │ │ │ ├── 404.md
│ │ │ │ │ ├── 500.md
│ │ │ │ │ └── 403.md
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── typeConfig.js
│ │ │ │ └── index.zh-CN.md
│ │ │ ├── PageLoading
│ │ │ │ └── index.js
│ │ │ ├── Result
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── demo
│ │ │ │ │ └── structure.md
│ │ │ │ ├── index.md
│ │ │ │ └── index.js
│ │ │ ├── EditableLinkGroup
│ │ │ │ └── index.less
│ │ │ ├── GlobalFooter
│ │ │ │ ├── index.md
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.less
│ │ │ │ ├── demo
│ │ │ │ │ └── basic.md
│ │ │ │ └── index.js
│ │ │ ├── Ellipsis
│ │ │ │ ├── index.zh-CN.md
│ │ │ │ ├── index.less
│ │ │ │ ├── index.test.js
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.en-US.md
│ │ │ │ └── demo
│ │ │ │ │ └── number.md
│ │ │ ├── NumberInfo
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.zh-CN.md
│ │ │ │ ├── demo
│ │ │ │ │ └── basic.md
│ │ │ │ └── index.en-US.md
│ │ │ ├── SettingDrawer
│ │ │ │ ├── ThemeColor.less
│ │ │ │ └── BlockChecbox.js
│ │ │ ├── EditableItem
│ │ │ │ └── index.less
│ │ │ ├── HeaderSearch
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.zh-CN.md
│ │ │ │ ├── index.less
│ │ │ │ ├── demo
│ │ │ │ │ └── basic.md
│ │ │ │ └── index.en-US.md
│ │ │ ├── ActiveChart
│ │ │ │ └── index.less
│ │ │ ├── ArticleListContent
│ │ │ │ ├── index.js
│ │ │ │ └── index.less
│ │ │ └── StandardFormRow
│ │ │ │ └── index.js
│ │ ├── layouts
│ │ │ ├── BlankLayout.js
│ │ │ ├── MenuContext.js
│ │ │ └── Header.less
│ │ ├── pages
│ │ │ ├── Exception
│ │ │ │ ├── style.less
│ │ │ │ ├── 403.js
│ │ │ │ ├── 404.js
│ │ │ │ ├── 500.js
│ │ │ │ └── models
│ │ │ │ │ └── error.js
│ │ │ ├── Profile
│ │ │ │ ├── BasicProfile.less
│ │ │ │ ├── models
│ │ │ │ │ └── profile.js
│ │ │ │ └── AdvancedProfile.less
│ │ │ ├── 404.js
│ │ │ ├── Account
│ │ │ │ ├── Settings
│ │ │ │ │ ├── PhoneView.less
│ │ │ │ │ ├── GeographicView.less
│ │ │ │ │ └── PhoneView.js
│ │ │ │ └── Center
│ │ │ │ │ └── Articles.less
│ │ │ ├── Result
│ │ │ │ └── Success.test.js
│ │ │ ├── User
│ │ │ │ ├── RegisterResult.less
│ │ │ │ ├── Login.less
│ │ │ │ ├── models
│ │ │ │ │ └── register.js
│ │ │ │ └── Register.less
│ │ │ ├── Authorized.js
│ │ │ ├── Dashboard
│ │ │ │ ├── Monitor.less
│ │ │ │ └── models
│ │ │ │ │ ├── monitor.js
│ │ │ │ │ └── activities.js
│ │ │ ├── document.ejs
│ │ │ └── List
│ │ │ │ ├── Articles.less
│ │ │ │ └── Applications.less
│ │ ├── services
│ │ │ ├── error.js
│ │ │ ├── user.js
│ │ │ └── geographic.js
│ │ ├── utils
│ │ │ ├── Authorized.js
│ │ │ ├── Yuan.js
│ │ │ ├── authority.test.js
│ │ │ └── authority.js
│ │ ├── defaultSettings.js
│ │ ├── global.less
│ │ ├── e2e
│ │ │ └── home.e2e.js
│ │ └── models
│ │ │ └── project.js
│ ├── .prettierignore
│ ├── public
│ │ └── favicon.png
│ ├── Dockerfile.dev
│ ├── scripts
│ │ └── generateMock.js
│ ├── jsconfig.json
│ ├── .prettierrc
│ ├── functions
│ │ ├── index.js
│ │ └── package.json
│ ├── .editorconfig
│ ├── .stylelintrc.json
│ ├── firebase.json
│ ├── docker
│ │ ├── docker-compose.dev.yml
│ │ ├── docker-compose.yml
│ │ └── nginx.conf
│ ├── mock
│ │ └── geographic.js
│ ├── tests
│ │ └── fix_puppeteer.sh
│ ├── .circleci
│ │ └── config.yml
│ ├── .dockerignore
│ ├── .gitignore
│ ├── Dockerfile
│ ├── appveyor.yml
│ ├── config
│ │ └── plugin.config.js
│ └── .eslintrc.js
└── src
│ └── main
│ ├── resources
│ └── dist
│ │ ├── favicon.png
│ │ ├── 32.chunk.css
│ │ ├── 38.chunk.css
│ │ ├── 40.chunk.css
│ │ ├── 48.async.js
│ │ ├── 14.chunk.css
│ │ ├── 36.async.js
│ │ ├── 37.async.js
│ │ ├── 29.chunk.css
│ │ ├── index.html
│ │ ├── 24.chunk.css
│ │ ├── 8.async.js
│ │ ├── 6.async.js
│ │ ├── 5.async.js
│ │ ├── 33.chunk.css
│ │ ├── 13.chunk.css
│ │ ├── 9.async.js
│ │ └── 17.chunk.css
│ └── scala
│ └── scalaweb
│ └── ant
│ └── design
│ └── pro
│ └── Main.scala
├── codes
├── scala-seed
│ ├── project
│ │ ├── build.properties
│ │ └── Dependencies.scala
│ ├── src
│ │ ├── main
│ │ │ └── scala
│ │ │ │ └── example
│ │ │ │ └── Hello.scala
│ │ └── test
│ │ │ └── scala
│ │ │ └── example
│ │ │ └── HelloSpec.scala
│ └── build.sbt
├── scripts
│ └── helloworld.scala
└── multi-project
│ ├── project
│ └── build.properties
│ ├── app
│ └── src
│ │ └── main
│ │ └── scala
│ │ └── multi
│ │ └── app
│ │ └── Application.scala
│ ├── common
│ └── src
│ │ ├── main
│ │ └── scala
│ │ │ └── multi
│ │ │ └── Utils.scala
│ │ └── test
│ │ └── scala
│ │ └── multi
│ │ └── UtilsTest.scala
│ └── build.sbt
├── docs
├── paradox.json
├── assets
│ ├── imgs
│ │ ├── 01.2.1.png
│ │ ├── 01.2.2.png
│ │ ├── 01.1.runMain.png
│ │ ├── 01.1.testOnly.png
│ │ ├── CassandraTable.png
│ │ ├── alipay-qrcode.jpg
│ │ ├── wepay-qrcode.jpg
│ │ ├── account-center-01.png
│ │ ├── akka-http-packages.png
│ │ ├── ant-design-pro-500.png
│ │ ├── json
│ │ │ └── JacksonSupportTest.png
│ │ ├── testOnly-AuthorRepositoryTest.png
│ │ ├── testOnly-UserRepositoryTest.png
│ │ ├── basic-web-server-request-steps.png
│ │ └── qrcode_for_gh_70b815e4a7cd_344.jpg
│ ├── images
│ │ └── favicon.png
│ └── fonts
│ │ ├── specimen
│ │ ├── FontAwesome.ttf
│ │ ├── FontAwesome.woff
│ │ ├── FontAwesome.woff2
│ │ ├── MaterialIcons-Regular.ttf
│ │ ├── MaterialIcons-Regular.woff
│ │ └── MaterialIcons-Regular.woff2
│ │ └── material-icons.css
└── lib
│ └── prettify
│ ├── prettify.css
│ └── lang-scala.js
├── oauth
├── src
│ ├── test
│ │ └── scala
│ │ │ └── sw.sc
│ └── main
│ │ ├── resources
│ │ └── application.conf
│ │ └── scala
│ │ └── scalaweb
│ │ └── auth
│ │ └── model
│ │ └── AuthRejection.scala
└── web
│ └── auth
│ └── authorize.html
├── common
└── src
│ ├── main
│ ├── protobuf
│ │ └── message
│ │ │ ├── model
│ │ │ └── org.proto
│ │ │ └── define.proto
│ ├── scala
│ │ ├── fusion
│ │ │ ├── json
│ │ │ │ └── jackson
│ │ │ │ │ └── CborSerializable.scala
│ │ │ └── http
│ │ │ │ └── server
│ │ │ │ └── AbstractRoute.scala
│ │ ├── helloscala
│ │ │ ├── common
│ │ │ │ ├── data
│ │ │ │ │ └── ApiResult.scala
│ │ │ │ ├── json
│ │ │ │ │ └── Json4sMethods.scala
│ │ │ │ └── IntStatus.scala
│ │ │ └── http
│ │ │ │ ├── HttpConstants.scala
│ │ │ │ └── package.scala
│ │ └── com
│ │ │ └── typesafe
│ │ │ └── config
│ │ │ └── impl
│ │ │ └── ConfigurationHelper.scala
│ └── resources
│ │ └── reference.conf
│ └── test
│ └── scala
│ └── helloscala
│ └── test
│ ├── HelloscalaSpec.scala
│ └── AkkaSpec.scala
├── data
└── src
│ └── main
│ └── scala
│ └── scalaweb
│ └── data
│ └── json
│ └── jackson
│ └── JacksonDemo.scala
├── config-discovery
└── src
│ ├── main
│ ├── resources
│ │ └── fusion-discovery-server.conf
│ └── scala
│ │ └── fusion
│ │ └── discovery
│ │ └── server
│ │ ├── naming
│ │ ├── data
│ │ │ └── Reply.scala
│ │ ├── NamingCommandWrapper.scala
│ │ ├── NamingRoute.scala
│ │ └── NamingSetting.scala
│ │ └── config
│ │ ├── ConfigCommandWrapper.scala
│ │ ├── ConfigRoute.scala
│ │ └── ConfigSetting.scala
│ ├── test
│ └── resources
│ │ ├── application.conf
│ │ └── logback-test.xml
│ └── multi-jvm
│ └── resources
│ ├── application.conf
│ └── logback-test.xml
├── foundation
└── src
│ ├── main
│ └── scala
│ │ ├── fileupload
│ │ ├── Constants.scala
│ │ ├── controller
│ │ │ └── HtmlRoute.scala
│ │ ├── util
│ │ │ └── Utils.scala
│ │ └── service
│ │ │ └── FileService.scala
│ │ ├── akkahttp
│ │ ├── foundation
│ │ │ ├── data
│ │ │ │ ├── domain
│ │ │ │ │ └── PageInput.scala
│ │ │ │ └── entity
│ │ │ │ │ ├── Author.scala
│ │ │ │ │ ├── Book.scala
│ │ │ │ │ └── User.scala
│ │ │ ├── route
│ │ │ │ ├── PageRoute.scala
│ │ │ │ └── Routes.scala
│ │ │ └── boot
│ │ │ │ └── Boot.scala
│ │ └── server
│ │ │ ├── BaseRoute.scala
│ │ │ └── Server.scala
│ │ └── me
│ │ └── yangbajing
│ │ ├── redis
│ │ └── RedisSession.scala
│ │ └── jdbc
│ │ └── WrappedResultSet.scala
│ └── test
│ └── scala
│ └── me
│ └── yangbajing
│ ├── redis
│ ├── RedisSessionTest.scala
│ └── RedisSpec.scala
│ ├── cassandra
│ └── CassandraSpec.scala
│ ├── jdbc
│ └── JDBCSpec.scala
│ └── MeSpec.scala
├── scripts
├── publish-book.sh
└── build-ant-design-pro.sh
├── Dockerfile
├── test
└── src
│ ├── test
│ └── scala
│ │ └── sw.sc
│ └── main
│ └── scala
│ └── scalaweb
│ └── service
│ └── OrgService.scala
└── .scalafmt.conf
/book/src/main/paradox/directives/cookie.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/book/src/main/paradox/directives/file.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/book/src/main/paradox/directives/method.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/book/src/main/paradox/directives/marshalling.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/book/src/main/paradox/oauth/oauth.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
--------------------------------------------------------------------------------
/project/build.properties:
--------------------------------------------------------------------------------
1 | sbt.version=1.3.3
2 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.eslintignore:
--------------------------------------------------------------------------------
1 | /functions/mock
2 |
--------------------------------------------------------------------------------
/book/src/main/paradox/data/data.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
3 |
--------------------------------------------------------------------------------
/book/src/main/paradox/directives/parameter_form.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/book/src/main/paradox/test/test.2.md:
--------------------------------------------------------------------------------
1 | # 测试异步代码
2 |
--------------------------------------------------------------------------------
/book/src/main/paradox/test/test.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
3 |
--------------------------------------------------------------------------------
/book/src/main/paradox/data/data.0.md:
--------------------------------------------------------------------------------
1 | # 数据
2 |
3 |
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/data/data.2.md:
--------------------------------------------------------------------------------
1 | # Protobuf
2 |
3 |
--------------------------------------------------------------------------------
/book/src/main/paradox/test/test.0.md:
--------------------------------------------------------------------------------
1 | # 测试
2 |
3 |
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/appendix/appendix.2.md:
--------------------------------------------------------------------------------
1 | # 词汇表
2 |
3 |
--------------------------------------------------------------------------------
/book/src/main/paradox/config-discovery/index.md:
--------------------------------------------------------------------------------
1 | # 实战:配置管理、服务发现系统
--------------------------------------------------------------------------------
/codes/scala-seed/project/build.properties:
--------------------------------------------------------------------------------
1 | sbt.version=1.2.8
2 |
--------------------------------------------------------------------------------
/codes/scripts/helloworld.scala:
--------------------------------------------------------------------------------
1 | println("你好,Scala!")
2 |
3 |
--------------------------------------------------------------------------------
/book/src/main/paradox/database/database.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
3 | TODO
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/scala/scala.7.md:
--------------------------------------------------------------------------------
1 | # Trait
2 |
3 | TODO
4 |
--------------------------------------------------------------------------------
/codes/multi-project/project/build.properties:
--------------------------------------------------------------------------------
1 | sbt.version=1.2.8
2 |
--------------------------------------------------------------------------------
/book/src/main/paradox/routing-dsl/exception.md:
--------------------------------------------------------------------------------
1 | # 异常处理
2 |
3 | TODO
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/oauth/oauth.3.md:
--------------------------------------------------------------------------------
1 | # OAuth 2服务实现
2 |
3 | TODO
4 |
5 |
--------------------------------------------------------------------------------
/book/src/main/paradox/routing-dsl/rejections.md:
--------------------------------------------------------------------------------
1 | # 拒绝 rejections
2 |
3 | TODO
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/engineering/swagger.md:
--------------------------------------------------------------------------------
1 | # 使用Swagger编写API文档
2 |
3 | TODO
4 |
5 |
--------------------------------------------------------------------------------
/docs/paradox.json:
--------------------------------------------------------------------------------
1 | {
2 | "name" : "Scala Web Development",
3 | "version" : "1.0.0"
4 | }
--------------------------------------------------------------------------------
/oauth/src/test/scala/sw.sc:
--------------------------------------------------------------------------------
1 | import pdi.jwt.{Jwt, JwtAlgorithm, JwtClaim, JwtHeader}
2 |
3 |
--------------------------------------------------------------------------------
/book/src/main/paradox/appendix/appendix.1.md:
--------------------------------------------------------------------------------
1 | # 专业术语
2 |
3 | - trait:特征,可以比做是具有方法实现和属性的接口。
4 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "antd-pro"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/ant-design-pro/web/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | testURL: 'http://localhost:8000',
3 | };
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/basic/basic.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
3 | 本章我们创建了我们的第一个 Akka HTTP 程序,并快速了过了下 Akka HTTP 所提供的功能。
4 |
--------------------------------------------------------------------------------
/common/src/main/protobuf/message/model/org.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package message.model;
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/TimelineChart/index.less:
--------------------------------------------------------------------------------
1 | .timelineChart {
2 | background: #fff;
3 | }
4 |
--------------------------------------------------------------------------------
/docs/assets/imgs/01.2.1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/01.2.1.png
--------------------------------------------------------------------------------
/docs/assets/imgs/01.2.2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/01.2.2.png
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/bizcharts.d.ts:
--------------------------------------------------------------------------------
1 | import * as BizChart from 'bizcharts';
2 |
3 | export = BizChart;
4 |
--------------------------------------------------------------------------------
/docs/assets/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/images/favicon.png
--------------------------------------------------------------------------------
/ant-design-pro/web/.prettierignore:
--------------------------------------------------------------------------------
1 | **/*.md
2 | **/*.svg
3 | **/*.ejs
4 | **/*.html
5 | package.json
6 | .umi
7 | .umi-production
8 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/bizcharts.js:
--------------------------------------------------------------------------------
1 | import * as BizChart from 'bizcharts';
2 |
3 | export default BizChart;
4 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/layouts/BlankLayout.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default props =>
;
4 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/layouts/MenuContext.js:
--------------------------------------------------------------------------------
1 | import { createContext } from 'react';
2 |
3 | export default createContext();
4 |
--------------------------------------------------------------------------------
/data/src/main/scala/scalaweb/data/json/jackson/JacksonDemo.scala:
--------------------------------------------------------------------------------
1 | package scalaweb.data.json.jackson
2 |
3 | class JacksonDemo {}
4 |
--------------------------------------------------------------------------------
/book/src/main/paradox/actor/actor-test.md:
--------------------------------------------------------------------------------
1 | # Akka Actor 测试
2 |
3 | ## Actor测试
4 |
5 | TODO
6 |
7 | ## 集群测试
8 |
9 | TODO
10 |
--------------------------------------------------------------------------------
/docs/assets/imgs/01.1.runMain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/01.1.runMain.png
--------------------------------------------------------------------------------
/docs/assets/imgs/01.1.testOnly.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/01.1.testOnly.png
--------------------------------------------------------------------------------
/docs/assets/imgs/CassandraTable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/CassandraTable.png
--------------------------------------------------------------------------------
/docs/assets/imgs/alipay-qrcode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/alipay-qrcode.jpg
--------------------------------------------------------------------------------
/docs/assets/imgs/wepay-qrcode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/wepay-qrcode.jpg
--------------------------------------------------------------------------------
/ant-design-pro/web/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/ant-design-pro/web/public/favicon.png
--------------------------------------------------------------------------------
/config-discovery/src/main/resources/fusion-discovery-server.conf:
--------------------------------------------------------------------------------
1 | fusion.http.default.server {
2 | host = "127.0.0.1"
3 | port = 8000
4 | }
--------------------------------------------------------------------------------
/docs/assets/imgs/account-center-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/account-center-01.png
--------------------------------------------------------------------------------
/docs/assets/imgs/akka-http-packages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/akka-http-packages.png
--------------------------------------------------------------------------------
/docs/assets/imgs/ant-design-pro-500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/ant-design-pro-500.png
--------------------------------------------------------------------------------
/book/src/main/paradox/actor/actor.z.md:
--------------------------------------------------------------------------------
1 | # Actor小结
2 |
3 | 有关 Akka 的更多内容可阅读作者写的另一本开源电子书: [Akka Cookbook](https://yangbajing.gitee.io/akka-cookbook/) 。
4 |
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/fonts/specimen/FontAwesome.ttf
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/01.2.1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/01.2.1.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/01.2.2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/01.2.2.png
--------------------------------------------------------------------------------
/book/src/main/paradox/env/env.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
3 | 本章介绍了怎样安装 Sbt 和 IDEA 作为 Scala 的开发环境,并介绍了怎样新建一个 Sbt 工程和怎样将一个 Sbt 工程导入到IDEA中。
4 |
5 | 接下来,我们将正式进入 Scala 的世界。
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/FontAwesome.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/fonts/specimen/FontAwesome.woff
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/FontAwesome.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/fonts/specimen/FontAwesome.woff2
--------------------------------------------------------------------------------
/docs/assets/imgs/json/JacksonSupportTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/json/JacksonSupportTest.png
--------------------------------------------------------------------------------
/common/src/main/scala/fusion/json/jackson/CborSerializable.scala:
--------------------------------------------------------------------------------
1 | package fusion.json.jackson
2 |
3 | trait CborSerializable
4 |
5 | trait JsonSerializable
6 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/ant-design-pro/src/main/resources/dist/favicon.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/01.1.runMain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/01.1.runMain.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/wepay-qrcode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/wepay-qrcode.jpg
--------------------------------------------------------------------------------
/codes/multi-project/app/src/main/scala/multi/app/Application.scala:
--------------------------------------------------------------------------------
1 | package multi.app
2 |
3 | object Application extends App {
4 | println("Application")
5 | }
6 |
--------------------------------------------------------------------------------
/codes/scala-seed/project/Dependencies.scala:
--------------------------------------------------------------------------------
1 | import sbt._
2 |
3 | object Dependencies {
4 | lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.5"
5 | }
6 |
--------------------------------------------------------------------------------
/docs/assets/imgs/testOnly-AuthorRepositoryTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/testOnly-AuthorRepositoryTest.png
--------------------------------------------------------------------------------
/docs/assets/imgs/testOnly-UserRepositoryTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/testOnly-UserRepositoryTest.png
--------------------------------------------------------------------------------
/foundation/src/main/scala/fileupload/Constants.scala:
--------------------------------------------------------------------------------
1 | package fileupload
2 |
3 | object Constants {
4 | val HASH_LENGTH = 64
5 | val FILE_PART_MAX = 8
6 | }
7 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/32.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-pages-profile-basic-profile-title{color:rgba(0,0,0,.85);font-size:16px;font-weight:500;margin-bottom:16px}
2 |
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/01.1.testOnly.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/01.1.testOnly.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/CassandraTable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/CassandraTable.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/alipay-qrcode.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/alipay-qrcode.jpg
--------------------------------------------------------------------------------
/common/src/main/protobuf/message/define.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package message;
4 |
5 | enum CommonStatus {
6 | DISABLE = 0;
7 | ENABLE = 1;
8 | }
9 |
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/MaterialIcons-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/fonts/specimen/MaterialIcons-Regular.ttf
--------------------------------------------------------------------------------
/docs/assets/imgs/basic-web-server-request-steps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/basic-web-server-request-steps.png
--------------------------------------------------------------------------------
/docs/assets/imgs/qrcode_for_gh_70b815e4a7cd_344.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/imgs/qrcode_for_gh_70b815e4a7cd_344.jpg
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Login/loginContext.js:
--------------------------------------------------------------------------------
1 | import { createContext } from 'react';
2 |
3 | const LoginContext = createContext();
4 | export default LoginContext;
5 |
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/account-center-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/account-center-01.png
--------------------------------------------------------------------------------
/book/src/main/scala/ws.sc:
--------------------------------------------------------------------------------
1 | import scala.concurrent.Future
2 | import scala.concurrent.ExecutionContext.Implicits.global
3 |
4 | val f = Future { 34 }
5 |
6 | f.foreach()
7 |
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/MaterialIcons-Regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/fonts/specimen/MaterialIcons-Regular.woff
--------------------------------------------------------------------------------
/docs/assets/fonts/specimen/MaterialIcons-Regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/docs/assets/fonts/specimen/MaterialIcons-Regular.woff2
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/akka-http-packages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/akka-http-packages.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/ant-design-pro-500.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/ant-design-pro-500.png
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/data/domain/PageInput.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.data.domain
2 |
3 | case class PageInput(title: String, content: String)
4 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/layouts/Header.less:
--------------------------------------------------------------------------------
1 | .fixedHeader {
2 | position: fixed;
3 | top: 0;
4 | right: 0;
5 | width: 100%;
6 | z-index: 9;
7 | transition: width 0.2s;
8 | }
9 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Exception/style.less:
--------------------------------------------------------------------------------
1 | .trigger {
2 | background: 'red';
3 | :global(.ant-btn) {
4 | margin-right: 8px;
5 | margin-bottom: 12px;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/services/error.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request';
2 |
3 | export default async function queryError(code) {
4 | return request(`/api/${code}`);
5 | }
6 |
--------------------------------------------------------------------------------
/book/src/main/paradox/engineering/index.md:
--------------------------------------------------------------------------------
1 | # 工程化
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | - [swagger](swagger.md)
8 | - [guice](guice.md)
9 |
10 | @@@
11 |
12 |
--------------------------------------------------------------------------------
/common/src/main/scala/helloscala/common/data/ApiResult.scala:
--------------------------------------------------------------------------------
1 | package helloscala.common.data
2 |
3 | case class ApiResult(errCode: Int, errMsg: String = "", data: Option[Any] = None)
4 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/TagCloud/index.less:
--------------------------------------------------------------------------------
1 | .tagCloud {
2 | overflow: hidden;
3 | canvas {
4 | transform: scale(0.25);
5 | transform-origin: 0 0;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/json/JacksonSupportTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/json/JacksonSupportTest.png
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/38.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-pages-exception-style-trigger{background:"red"}.antd-pro-pages-exception-style-trigger .ant-btn{margin-bottom:12px;margin-right:8px}
2 |
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/testOnly-UserRepositoryTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/testOnly-UserRepositoryTest.png
--------------------------------------------------------------------------------
/codes/multi-project/common/src/main/scala/multi/Utils.scala:
--------------------------------------------------------------------------------
1 | package multi
2 |
3 | object Utils {
4 | def isBlank(str: String): Boolean = str == null || str.isEmpty || str.forall(_ == ' ')
5 | }
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/testOnly-AuthorRepositoryTest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/testOnly-AuthorRepositoryTest.png
--------------------------------------------------------------------------------
/book/src/main/paradox/server-api/index.md:
--------------------------------------------------------------------------------
1 | # 服务端API
2 |
3 | @@toc { depth=3 }
4 |
5 | @@@ index
6 |
7 | * [Akka HTTP 如何使得 Web 工作](work.md)
8 | * [高级服务端 API](advanced.md)
9 |
10 | @@@
11 |
--------------------------------------------------------------------------------
/book/src/main/paradox/appendix/index.md:
--------------------------------------------------------------------------------
1 | # 附录
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | * [参考资料](appendix.0.md)
8 | * [专业术语](appendix.1.md)
9 | * [词汇表](appendix.2.md)
10 |
11 | @@@
12 |
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/basic-web-server-request-steps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/basic-web-server-request-steps.png
--------------------------------------------------------------------------------
/book/src/main/paradox/assets/imgs/qrcode_for_gh_70b815e4a7cd_344.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yangbajing/scala-web-development/HEAD/book/src/main/paradox/assets/imgs/qrcode_for_gh_70b815e4a7cd_344.jpg
--------------------------------------------------------------------------------
/book/src/main/paradox/database/database.2.md:
--------------------------------------------------------------------------------
1 | # 使用 Slick 访问数据库
2 |
3 | 详细见 **《Slick 开发》** https://www.yangbajing.me/slick-development/
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/DescriptionList/responsive.js:
--------------------------------------------------------------------------------
1 | export default {
2 | 1: { xs: 24 },
3 | 2: { xs: 24, sm: 12 },
4 | 3: { xs: 24, sm: 12, md: 8 },
5 | 4: { xs: 24, sm: 12, md: 6 },
6 | };
7 |
--------------------------------------------------------------------------------
/book/src/main/paradox/actor/index.md:
--------------------------------------------------------------------------------
1 | # Akka Actor
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | * [actor](actor.md)
8 | * [actor-test](actor-test.md)
9 | * [小结](actor.z.md)
10 |
11 | @@@
12 |
--------------------------------------------------------------------------------
/scripts/publish-book.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | #sbt book/paradox
4 |
5 | if [ ! -d docs ]; then
6 | mkdir docs
7 | fi
8 | rm -rf docs/*
9 | cp -r book/target/paradox/site/main/* docs/
10 |
11 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/40.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-pages-account-center-articles-articleList .ant-list-item:first-child{padding-top:0}a.antd-pro-pages-account-center-articles-listItemMetaTitle{color:rgba(0,0,0,.85)}
2 |
--------------------------------------------------------------------------------
/ant-design-pro/web/Dockerfile.dev:
--------------------------------------------------------------------------------
1 | FROM node:latest
2 |
3 | WORKDIR /usr/src/app/
4 |
5 | COPY package.json ./
6 | RUN npm install --silent --no-cache
7 |
8 | COPY ./ ./
9 |
10 |
11 | CMD ["npm", "run", "start"]
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Profile/BasicProfile.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .title {
4 | color: @heading-color;
5 | font-size: 16px;
6 | font-weight: 500;
7 | margin-bottom: 16px;
8 | }
9 |
--------------------------------------------------------------------------------
/ant-design-pro/web/scripts/generateMock.js:
--------------------------------------------------------------------------------
1 | const generateMock = require('merge-umi-mock-data');
2 | const path = require('path');
3 | generateMock(path.join(__dirname, '../mock'), path.join(__dirname, '../functions/mock/index.js'));
4 |
--------------------------------------------------------------------------------
/codes/scala-seed/src/main/scala/example/Hello.scala:
--------------------------------------------------------------------------------
1 | package example
2 |
3 | object Hello extends Greeting with App {
4 | println(greeting)
5 | }
6 |
7 | trait Greeting {
8 | lazy val greeting: String = "hello"
9 | }
10 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/data/entity/Author.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.data.entity
2 |
3 | // #Author
4 | case class Author(id: Long, name: String, age: Option[Int], remark: Option[String])
5 | // #Author
6 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/DescriptionList/index.js:
--------------------------------------------------------------------------------
1 | import DescriptionList from './DescriptionList';
2 | import Description from './Description';
3 |
4 | DescriptionList.Description = Description;
5 | export default DescriptionList;
6 |
--------------------------------------------------------------------------------
/ant-design-pro/web/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "emitDecoratorMetadata": true,
4 | "experimentalDecorators": true,
5 | "baseUrl": ".",
6 | "paths": {
7 | "@/*": ["./src/*"]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/book/src/main/paradox/test/index.md:
--------------------------------------------------------------------------------
1 | # 测试
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | * [测试](test.0.md)
8 | * [Scalatest](test.1.md)
9 | * [测试异步代码](test.2.md)
10 | * [端到端测试Route](test.3.md)
11 | * [小结](test.z.md)
12 |
13 | @@@
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageHeaderWrapper/GridContent.less:
--------------------------------------------------------------------------------
1 | .main {
2 | width: 100%;
3 | height: 100%;
4 | min-height: 100%;
5 | transition: 0.3s;
6 | &.wide {
7 | max-width: 1200px;
8 | margin: 0 auto;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "es5",
4 | "printWidth": 100,
5 | "overrides": [
6 | {
7 | "files": ".prettierrc",
8 | "options": { "parser": "json" }
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/book/src/main/paradox/scala/scala.z.md:
--------------------------------------------------------------------------------
1 | # 小结
2 |
3 | 本章简单的介绍了Scala的语言特性,本文并不只限于Java程序员,任何有编程经验的程序员都可以看。现在你应该对Scala有了一个基础的认识,并可以写一些
4 | 简单的代码了。在我的 [博客](http://yangbajing.me) 中分享了一些《Scala实战(系列)》文章,介绍更
5 | **函数式** 的写法及与实际工程中结合的例子。
6 | 也欢迎对Scala感兴趣的同学与我联系,一起交流、学习。
--------------------------------------------------------------------------------
/ant-design-pro/web/src/services/user.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request';
2 |
3 | export async function query() {
4 | return request('/api/users');
5 | }
6 |
7 | export async function queryCurrent() {
8 | return request('/api/currentUser');
9 | }
10 |
--------------------------------------------------------------------------------
/book/src/main/paradox/database/database.0.md:
--------------------------------------------------------------------------------
1 | # 访问数据库
2 |
3 | 本章将介绍在 Akka HTTP 里怎样访问数据库,我们将使用 JDBC 来操作关系数据库,同时也将介绍怎样访问 NoSQL 数据库。
4 |
5 | *本章代码见:[codes/akka-http-foundation](https://github.com/yangbajing/scala-web-development/tree/master/codes/akka-http-foundation)*
6 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM postgresql:10
2 |
3 | RUN localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8
4 |
5 | ENV TZ Asia/Shanghai
6 | ENV LANG zh_CN.UTF-8
7 |
8 | COPY scripts/init.sql /docker-entrypoint-initdb.d/
9 |
10 | EXPOSE 5432
11 |
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/DescriptionList/Description.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export default class Description extends React.Component<
4 | {
5 | term: React.ReactNode;
6 | style?: React.CSSProperties;
7 | },
8 | any
9 | > {}
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/404.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Link from 'umi/link';
3 | import Exception from '@/components/Exception';
4 |
5 | export default () => (
6 |
7 | );
8 |
--------------------------------------------------------------------------------
/codes/scala-seed/src/test/scala/example/HelloSpec.scala:
--------------------------------------------------------------------------------
1 | package example
2 |
3 | import org.scalatest._
4 |
5 | class HelloSpec extends FlatSpec with Matchers {
6 | "The Hello object" should "say hello" in {
7 | Hello.greeting shouldEqual "hello"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NoticeIcon/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title: 通知图标
4 | ---
5 |
6 | 通常用在导航工具栏上。
7 |
8 | ````jsx
9 | import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
10 |
11 | ReactDOM.render(, mountNode);
12 | ````
13 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageHeaderWrapper/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .content {
4 | margin: 24px 24px 0;
5 | }
6 |
7 | @media screen and (max-width: @screen-sm) {
8 | .content {
9 | margin: 24px 0 0;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/book/src/main/paradox/oauth/index.md:
--------------------------------------------------------------------------------
1 | # 实战:实现OAuth 2服务
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | * [实战:实现OAuth 2服务](oauth.0.md)
8 | * [OAuth 2简介](oauth.1.md)
9 | * [OAuth 2接口设计](oauth.2.md)
10 | * [OAuth 2服务实现](oauth.3.md)
11 | * [小结](oauth.z.md)
12 |
13 | @@@
14 |
--------------------------------------------------------------------------------
/book/src/main/paradox/env/index.md:
--------------------------------------------------------------------------------
1 | # Scala 环境配置
2 |
3 | [http://scala-lang.org/download/](http://scala-lang.org/download/) 安装标准 Scala 开发包。
4 |
5 | @@toc { depth=2 }
6 |
7 | @@@ index
8 |
9 | * [Sbt](env.1.md)
10 | * [IDE开发工具](env.2.md)
11 | * [小结](env.z.md)
12 |
13 | @@@
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Account/Settings/PhoneView.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .area_code {
4 | max-width: 128px;
5 | margin-right: 8px;
6 | width: 30%;
7 | }
8 | .phone_number {
9 | max-width: 312px;
10 | width: ~'calc(70% - 8px)';
11 | }
12 |
--------------------------------------------------------------------------------
/book/src/main/paradox/basic/index.md:
--------------------------------------------------------------------------------
1 | # Akka HTTP 基础
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | * [Akka HTTP 基础](basic.0.md)
8 | * [Web 工作方式](basic.1.md)
9 | * [使用 Akka HTTP 搭建一个简单的 Web 服务](basic.2.md)
10 | * [Akka HTTP 的通用抽象](basic.3.md)
11 | * [小结](basic.z.md)
12 |
13 | @@@
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/FooterToolbar/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IFooterToolbarProps {
3 | extra: React.ReactNode;
4 | style?: React.CSSProperties;
5 | }
6 |
7 | export default class FooterToolbar extends React.Component {}
8 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/data/entity/Book.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.data.entity
2 |
3 | // #Book
4 | case class Book(
5 | isbn: String,
6 | author: Long,
7 | title: String,
8 | amount: BigDecimal,
9 | description: Option[String])
10 | // #Book
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Field/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IFieldProps {
3 | label: React.ReactNode;
4 | value: React.ReactNode;
5 | style?: React.CSSProperties;
6 | }
7 |
8 | export default class Field extends React.Component {}
9 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/StandardTable/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .standardTable {
4 | :global {
5 | .ant-table-pagination {
6 | margin-top: 24px;
7 | }
8 | }
9 |
10 | .tableAlert {
11 | margin-bottom: 16px;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Account/Center/Articles.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .articleList {
4 | :global {
5 | .ant-list-item:first-child {
6 | padding-top: 0;
7 | }
8 | }
9 | }
10 | a.listItemMetaTitle {
11 | color: @heading-color;
12 | }
13 |
--------------------------------------------------------------------------------
/scripts/build-ant-design-pro.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | pushd ant-design-pro/web
4 | yarn install
5 | yarn run build
6 | popd
7 | rm -rf ant-design-pro/src/main/resources/dist/*
8 | cp ant-design-pro/web/dist/* ant-design-pro/src/main/resources/dist/
9 | sbt "project ant-design-pro" assembly
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/mini-progress.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 3
3 | title: 迷你进度条
4 | ---
5 |
6 | ````jsx
7 | import { MiniProgress } from 'ant-design-pro/lib/Charts';
8 |
9 | ReactDOM.render(
10 |
11 | , mountNode);
12 | ````
13 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/g2.js:
--------------------------------------------------------------------------------
1 | // 全局 G2 设置
2 | import { track, setTheme } from 'bizcharts';
3 |
4 | track(false);
5 |
6 | const config = {
7 | defaultColor: '#1089ff',
8 | shape: {
9 | interval: {
10 | fillOpacity: 1,
11 | },
12 | },
13 | };
14 |
15 | setTheme(config);
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/TagSelect/TagSelectOption.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export interface ITagSelectOptionProps {
4 | value: string | number;
5 | style?: React.CSSProperties;
6 | }
7 |
8 | export default class TagSelectOption extends React.Component {}
9 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/services/geographic.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request';
2 |
3 | export async function queryProvince() {
4 | return request('/api/geographic/province');
5 | }
6 |
7 | export async function queryCity(province) {
8 | return request(`/api/geographic/city/${province}`);
9 | }
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/functions/index.js:
--------------------------------------------------------------------------------
1 | // [START functionsimport]
2 | const functions = require('firebase-functions');
3 | const express = require('express');
4 | const matchMock = require('./matchMock');
5 | const app = express();
6 |
7 | app.use(matchMock);
8 |
9 | exports.api = functions.https.onRequest(app);
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageHeader/breadcrumb.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { IPageHeaderProps } from './index'
3 |
4 | export default class BreadcrumbView extends React.Component {}
5 |
6 | export function getBreadcrumb(breadcrumbNameMap: Object, url: string): Object;
7 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/SelectLang/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .menu {
4 | :global(.anticon) {
5 | margin-right: 8px;
6 | }
7 | :global(.ant-dropdown-menu-item) {
8 | width: 160px;
9 | }
10 | }
11 |
12 | .dropDown {
13 | cursor: pointer;
14 | }
15 |
--------------------------------------------------------------------------------
/oauth/src/main/resources/application.conf:
--------------------------------------------------------------------------------
1 | akka {
2 | actor.provider = cluster
3 |
4 | remote {
5 | artery {
6 | enabled = on
7 | canonical.hostname = "127.0.0.1"
8 | canonical.port = 30011
9 | }
10 | }
11 |
12 | cluster {
13 | seeds = ["akka://oauth:30111"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/test/src/test/scala/sw.sc:
--------------------------------------------------------------------------------
1 | import java.time.OffsetDateTime
2 |
3 | import scala.math.Numeric.{IntIsIntegral, LongIsIntegral}
4 |
5 | val str = "2018-10-09T02:03:38.685+08:00"
6 |
7 | OffsetDateTime.parse(str)
8 |
9 | IntIsIntegral.zero - IntIsIntegral.one
10 | LongIsIntegral.zero - LongIsIntegral.one
11 |
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Trend/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export interface ITrendProps {
4 | colorful?: boolean;
5 | flag: 'up' | 'down';
6 | style?: React.CSSProperties;
7 | reverseColor?: boolean;
8 | }
9 |
10 | export default class Trend extends React.Component {}
11 |
--------------------------------------------------------------------------------
/common/src/main/scala/helloscala/common/json/Json4sMethods.scala:
--------------------------------------------------------------------------------
1 | //package helloscala.common.json
2 | //
3 | //import com.fasterxml.jackson.databind.ObjectMapper
4 | //import org.json4s.jackson.JsonMethods
5 | //
6 | //object Json4sMethods extends JsonMethods {
7 | // override def mapper: ObjectMapper = Jackson.defaultObjectMapper
8 | //}
9 |
--------------------------------------------------------------------------------
/common/src/main/scala/helloscala/http/HttpConstants.scala:
--------------------------------------------------------------------------------
1 | package helloscala.http
2 |
3 | object HttpConstants {
4 | val CONFIG_PATH_PREFIX = "helloscala.akka-http"
5 | val HS_APP_ID = "hs-app-id"
6 | val HS_TIMESTAMP = "hs-timestamp"
7 | val HS_ECHO_STR = "hs-echo-str"
8 | val HS_ACCESS_TOKEN = "hs-access-token"
9 | }
10 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/fileupload/controller/HtmlRoute.scala:
--------------------------------------------------------------------------------
1 | package fileupload.controller
2 |
3 | import akka.http.scaladsl.server.Directives._
4 | import akka.http.scaladsl.server.Route
5 |
6 | class HtmlRoute {
7 | def route: Route = pathPrefix("file-upload") {
8 | getFromResourceDirectory("file-upload")
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
15 | [Makefile]
16 | indent_style = tab
17 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.stylelintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["stylelint-config-standard", "stylelint-config-prettier"],
3 | "rules": {
4 | "declaration-empty-line-before": null,
5 | "no-descending-specificity": null,
6 | "selector-pseudo-class-no-unknown": null,
7 | "selector-pseudo-element-colon-notation": null
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": {
3 | "public": "dist",
4 | "rewrites": [
5 | { "source": "/api/**", "function": "api" },
6 | {
7 | "source": "**",
8 | "destination": "/index.html"
9 | }
10 | ],
11 | "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Field/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import styles from './index.less';
4 |
5 | const Field = ({ label, value, ...rest }) => (
6 |
7 | {label}
8 | {value}
9 |
10 | );
11 |
12 | export default Field;
13 |
--------------------------------------------------------------------------------
/oauth/src/main/scala/scalaweb/auth/model/AuthRejection.scala:
--------------------------------------------------------------------------------
1 | package scalaweb.auth.model
2 |
3 | import akka.http.scaladsl.server.RejectionWithOptionalCause
4 |
5 | case class AuthRejection(message: String, cause: Option[Throwable] = None)
6 | extends akka.http.javadsl.server.AuthorizationFailedRejection
7 | with RejectionWithOptionalCause
8 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/CountDown/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface ICountDownProps {
3 | format?: (time: number) => void;
4 | target: Date | number;
5 | onEnd?: () => void;
6 | style?: React.CSSProperties;
7 | }
8 |
9 | export default class CountDown extends React.Component {}
10 |
--------------------------------------------------------------------------------
/config-discovery/src/test/resources/application.conf:
--------------------------------------------------------------------------------
1 | include "fusion-discovery-server.conf"
2 | akka.cluster.jmx.multi-mbeans-in-same-jvm = on
3 | akka.grpc.client {
4 | "fusion.discovery.grpc.ConfigService" {
5 | host = ${fusion.http.default.server.host}
6 | port = ${fusion.http.default.server.port}
7 | use-tls = false
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/TagCloud/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface ITagCloudProps {
3 | data: Array<{
4 | name: string;
5 | value: number;
6 | }>;
7 | height: number;
8 | style?: React.CSSProperties;
9 | }
10 |
11 | export default class TagCloud extends React.Component {}
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/Authorized.js:
--------------------------------------------------------------------------------
1 | import CheckPermissions from './CheckPermissions';
2 |
3 | const Authorized = ({ children, authority, noMatch = null }) => {
4 | const childrenRender = typeof children === 'undefined' ? null : children;
5 | return CheckPermissions(authority, childrenRender, noMatch);
6 | };
7 |
8 | export default Authorized;
9 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/AvatarList/AvatarItem.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IAvatarItemProps {
3 | tips: React.ReactNode;
4 | src: string;
5 | style?: React.CSSProperties;
6 | }
7 |
8 | export default class AvatarItem extends React.Component {
9 | constructor(props: IAvatarItemProps);
10 | }
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/WaterWave/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IWaterWaveProps {
3 | title: React.ReactNode;
4 | color?: string;
5 | height: number;
6 | percent: number;
7 | style?: React.CSSProperties;
8 | }
9 |
10 | export default class WaterWave extends React.Component {}
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/gauge.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 7
3 | title: 仪表盘
4 | ---
5 |
6 | 仪表盘是一种进度展示方式,可以更直观的展示当前的进展情况,通常也可表示占比。
7 |
8 | ````jsx
9 | import { Gauge } from 'ant-design-pro/lib/Charts';
10 |
11 | ReactDOM.render(
12 |
17 | , mountNode);
18 | ````
19 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/_utils/pathTools.js:
--------------------------------------------------------------------------------
1 | // /userinfo/2144/id => ['/userinfo','/useinfo/2144,'/userindo/2144/id']
2 | // eslint-disable-next-line import/prefer-default-export
3 | export function urlToList(url) {
4 | const urllist = url.split('/').filter(i => i);
5 | return urllist.map((urlItem, index) => `/${urllist.slice(0, index + 1).join('/')}`);
6 | }
7 |
--------------------------------------------------------------------------------
/book/src/main/paradox/database/index.md:
--------------------------------------------------------------------------------
1 | # 访问数据库
2 |
3 | @@toc { depth=2 }
4 |
5 | @@@ index
6 |
7 | * [访问数据库](database.0.md)
8 | * [使用 JDBC 访问 PostgreSQL](database.1.md)
9 | * [使用 Slick 访问](database.2.md)
10 | * [访问 Cassandra 数据库](database.3.md)
11 | * [使用 Redis](database.4.md)
12 | * [使用 Elasticsearch](database.5.md)
13 | * [小结](database.z.md)
14 |
15 | @@@
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Gauge/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IGaugeProps {
3 | title: React.ReactNode;
4 | color?: string;
5 | height: number;
6 | bgColor?: number;
7 | percent: number;
8 | style?: React.CSSProperties;
9 | }
10 |
11 | export default class Gauge extends React.Component {}
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Exception/demo/404.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 404
5 | en-US: 404
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 404 页面。
11 |
12 | ## en-US
13 |
14 | 404 page.
15 |
16 | ````jsx
17 | import Exception from 'ant-design-pro/lib/Exception';
18 |
19 | ReactDOM.render(
20 |
21 | , mountNode);
22 | ````
23 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Exception/demo/500.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: 500
5 | en-US: 500
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 500 页面。
11 |
12 | ## en-US
13 |
14 | 500 page.
15 |
16 | ````jsx
17 | import Exception from 'ant-design-pro/lib/Exception';
18 |
19 | ReactDOM.render(
20 |
21 | , mountNode);
22 | ````
23 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageLoading/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Spin } from 'antd';
3 |
4 | // loading components from code split
5 | // https://umijs.org/plugin/umi-plugin-react.html#dynamicimport
6 | export default () => (
7 |
8 |
9 |
10 | );
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Result/Success.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { shallow } from 'enzyme';
3 | import Success from './Success';
4 |
5 | it('renders with Result', () => {
6 | const wrapper = shallow();
7 | expect(wrapper.find('Result').length).toBe(1);
8 | expect(wrapper.find('Result').prop('type')).toBe('success');
9 | });
10 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/MiniProgress/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IMiniProgressProps {
3 | target: number;
4 | color?: string;
5 | strokeWidth?: number;
6 | percent?: number;
7 | style?: React.CSSProperties;
8 | }
9 |
10 | export default class MiniProgress extends React.Component {}
11 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/mini-pie.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 6
3 | title: 迷你饼状图
4 | ---
5 |
6 | 通过简化 `Pie` 属性的设置,可以快速的实现极简的饼状图,可配合 `ChartCard` 组合展
7 | 现更多业务场景。
8 |
9 | ```jsx
10 | import { Pie } from 'ant-design-pro/lib/Charts';
11 |
12 | ReactDOM.render(
13 | ,
14 | mountNode
15 | );
16 | ```
17 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/User/RegisterResult.less:
--------------------------------------------------------------------------------
1 | .registerResult {
2 | :global {
3 | .anticon {
4 | font-size: 64px;
5 | }
6 | }
7 | .title {
8 | margin-top: 32px;
9 | font-size: 20px;
10 | line-height: 28px;
11 | }
12 | .actions {
13 | margin-top: 40px;
14 | a + a {
15 | margin-left: 8px;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/MiniBar/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IMiniBarProps {
3 | color?: string;
4 | height: number;
5 | data: Array<{
6 | x: number | string;
7 | y: number;
8 | }>;
9 | style?: React.CSSProperties;
10 | }
11 |
12 | export default class MiniBar extends React.Component {}
13 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Trend/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title: 演示
4 | ---
5 |
6 | 在数值背后添加一个小图标来标识涨跌情况。
7 |
8 | ````jsx
9 | import Trend from 'ant-design-pro/lib/Trend';
10 |
11 | ReactDOM.render(
12 |
13 | 12%
14 | 11%
15 |
16 | , mountNode);
17 | ````
18 |
--------------------------------------------------------------------------------
/codes/scala-seed/build.sbt:
--------------------------------------------------------------------------------
1 | import Dependencies._
2 |
3 | lazy val `scala-seed` = (project in file(".")).
4 | settings(
5 | inThisBuild(List(
6 | organization := "me.yangbajing",
7 | scalaVersion := "2.12.7",
8 | version := "0.1.0-SNAPSHOT"
9 | )),
10 | name := "scala-seed",
11 | libraryDependencies += scalaTest % Test
12 | )
13 |
14 |
--------------------------------------------------------------------------------
/book/src/main/paradox/scala/index.md:
--------------------------------------------------------------------------------
1 | # Scala 语言基础
2 |
3 | @@toc { depth=3 }
4 |
5 | @@@ index
6 |
7 | * [REPL](scala.0.md)
8 | * [你好,Scala](scala.1.md)
9 | * [Scala基础](scala.2.md)
10 | * [流程和函数](scala.3.md)
11 | * [集合](scala.4.md)
12 | * [class和object](scala.5.md)
13 | * [函数式](scala.6.md)
14 | * [trait](scala.7.md)
15 | * [并发](scala.8.md)
16 | * [小结](scala.z.md)
17 |
18 | @@@
19 |
--------------------------------------------------------------------------------
/common/src/main/scala/fusion/http/server/AbstractRoute.scala:
--------------------------------------------------------------------------------
1 | package fusion.http.server
2 |
3 | import akka.http.scaladsl.model.StatusCodes
4 | import akka.http.scaladsl.server.Directives
5 | import akka.http.scaladsl.server.Route
6 |
7 | trait AbstractRoute extends Directives {
8 | def route: Route
9 |
10 | val completeNotImplemented = complete(StatusCodes.NotImplemented)
11 | }
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/FooterToolbar/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: FooterToolbar
3 | subtitle: 底部工具栏
4 | cols: 1
5 | order: 6
6 | ---
7 |
8 | 固定在底部的工具栏。
9 |
10 | ## 何时使用
11 |
12 | 固定在内容区域的底部,不随滚动条移动,常用于长页面的数据搜集和提交工作。
13 |
14 | ## API
15 |
16 | 参数 | 说明 | 类型 | 默认值
17 | ----|------|-----|------
18 | children | 工具栏内容,向右对齐 | ReactNode | -
19 | extra | 额外信息,向左对齐 | ReactNode | -
20 |
--------------------------------------------------------------------------------
/common/src/main/resources/reference.conf:
--------------------------------------------------------------------------------
1 | scalaweb {
2 | persistence {
3 | datasource {
4 | dataSourceClassName = "org.postgresql.ds.PGSimpleDataSource"
5 | dataSource = {
6 | serverName = "localhost"
7 | portNumber = 5432
8 | databaseName = "scaladb"
9 | user = "scala"
10 | password = "Scala.2018"
11 | }
12 | }
13 |
14 | }
15 | }
--------------------------------------------------------------------------------
/ant-design-pro/web/docker/docker-compose.dev.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | ant-design-pro_dev:
5 | ports:
6 | - 8000:8000
7 | build:
8 | context: ../
9 | dockerfile: Dockerfile.dev
10 | container_name: "ant-design-pro_dev"
11 | volumes:
12 | - ../src:/usr/src/app/src
13 | - ../config:/usr/src/app/config
14 | - ../mock:/usr/src/app/mock
15 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/48.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[48],{w2l6:function(e,t,n){"use strict";var l=n("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var u=l(n("q1tI")),a=l(n("mOP9")),i=l(n("luV/")),d=function(){return u.default.createElement(i.default,{type:"404",style:{minHeight:500,height:"100%"},linkElement:a.default})};t.default=d}}]);
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Field/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .field {
4 | white-space: nowrap;
5 | overflow: hidden;
6 | text-overflow: ellipsis;
7 | margin: 0;
8 | span {
9 | font-size: @font-size-base;
10 | line-height: 22px;
11 | }
12 | span:last-child {
13 | margin-left: 8px;
14 | color: @heading-color;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Result/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IResultProps {
3 | type: 'success' | 'error';
4 | title: React.ReactNode;
5 | description?: React.ReactNode;
6 | extra?: React.ReactNode;
7 | actions?: React.ReactNode;
8 | style?: React.CSSProperties;
9 | }
10 |
11 | export default class Result extends React.Component {}
12 |
--------------------------------------------------------------------------------
/book/src/main/paradox/donate.md:
--------------------------------------------------------------------------------
1 | # 赞助
2 |
3 | 若您觉得本书写得还不错,谢谢赞助作者:
4 |
5 |
6 |
7 |
支付宝
8 |

9 |
10 |
11 |
微信
12 |

13 |
14 |
15 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/data/entity/User.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.data.entity
2 |
3 | import java.time.LocalDateTime
4 | import java.util.UUID
5 |
6 | /**
7 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-24.
8 | */
9 | case class User(
10 | id: UUID,
11 | email: String = "",
12 | name: String = "",
13 | createdAt: LocalDateTime = LocalDateTime.now())
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/EditableLinkGroup/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .linkGroup {
4 | padding: 20px 0 8px 24px;
5 | font-size: 0;
6 | & > a {
7 | color: @text-color;
8 | display: inline-block;
9 | font-size: @font-size-base;
10 | margin-bottom: 13px;
11 | width: 25%;
12 | &:hover {
13 | color: @primary-color;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Trend/demo/reverse.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title: 颜色反转
4 | ---
5 |
6 | 在数值背后添加一个小图标来标识涨跌情况。
7 |
8 | ````jsx
9 | import Trend from 'ant-design-pro/lib/Trend';
10 |
11 | ReactDOM.render(
12 |
13 | 12%
14 | 11%
15 |
16 | , mountNode);
17 | ````
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/GlobalFooter/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | en-US: GlobalFooter
4 | zh-CN: GlobalFooter
5 | subtitle: 全局页脚
6 | cols: 1
7 | order: 7
8 | ---
9 |
10 | 页脚属于全局导航的一部分,作为对顶部导航的补充,通过传递数据控制展示内容。
11 |
12 | ## API
13 |
14 | 参数 | 说明 | 类型 | 默认值
15 | ----|------|-----|------
16 | links | 链接数据 | array<{ title: ReactNode, href: string, blankTarget?: boolean }> | -
17 | copyright | 版权信息 | ReactNode | -
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/index.less:
--------------------------------------------------------------------------------
1 | .miniChart {
2 | position: relative;
3 | width: 100%;
4 | .chartContent {
5 | position: absolute;
6 | bottom: -28px;
7 | width: 100%;
8 | > div {
9 | margin: 0 -5px;
10 | overflow: hidden;
11 | }
12 | }
13 | .chartLoading {
14 | position: absolute;
15 | top: 16px;
16 | left: 50%;
17 | margin-left: -7px;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/waterwave.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 8
3 | title: 水波图
4 | ---
5 |
6 | 水波图是一种比例的展示方式,可以更直观的展示关键值的占比。
7 |
8 | ````jsx
9 | import { WaterWave } from 'ant-design-pro/lib/Charts';
10 |
11 | ReactDOM.render(
12 |
13 |
18 |
19 | , mountNode);
20 | ````
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/utils/Authorized.js:
--------------------------------------------------------------------------------
1 | import RenderAuthorized from '@/components/Authorized';
2 | import { getAuthority } from './authority';
3 |
4 | let Authorized = RenderAuthorized(getAuthority()); // eslint-disable-line
5 |
6 | // Reload the rights component
7 | const reloadAuthorized = () => {
8 | Authorized = RenderAuthorized(getAuthority());
9 | };
10 |
11 | export { reloadAuthorized };
12 | export default Authorized;
13 |
--------------------------------------------------------------------------------
/book/src/main/paradox/env/env.2.md:
--------------------------------------------------------------------------------
1 | # IDE开发工具
2 |
3 | 推荐使用 Jetbrains IDEA 进行Scala开发,请到官网 [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/) 下载。
4 |
5 | 我们需要安装 [Scala 插件](http://plugins.jetbrains.com/plugin/1347-scala)。
6 |
7 | ## 导入 Sbt 工程
8 |
9 | 导入 Sbt 工程非常的简单,使用 IDEA 直接打开工程目录即可(需要注意选择:Sbt项目)。
10 |
11 | 
12 |
13 | 选中目录后,IDEA 将开始导入工程,这里你可以对导入选项做一些自定义。
14 |
15 | 
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/GlobalFooter/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IGlobalFooterProps {
3 | links?: Array<{
4 | key?: string;
5 | title: React.ReactNode;
6 | href: string;
7 | blankTarget?: boolean;
8 | }>;
9 | copyright?: React.ReactNode;
10 | style?: React.CSSProperties;
11 | }
12 |
13 | export default class GlobalFooter extends React.Component {}
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Account/Settings/GeographicView.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .row {
4 | .item {
5 | max-width: 220px;
6 | width: 50%;
7 | }
8 | .item:first-child {
9 | margin-right: 8px;
10 | width: ~'calc(50% - 8px)';
11 | }
12 | }
13 |
14 | @media screen and (max-width: @screen-sm) {
15 | .item:first-child {
16 | margin: 0;
17 | margin-bottom: 8px;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ant-design-pro/web/mock/geographic.js:
--------------------------------------------------------------------------------
1 | import city from './geographic/city.json';
2 | import province from './geographic/province.json';
3 |
4 | function getProvince(req, res) {
5 | return res.json(province);
6 | }
7 |
8 | function getCity(req, res) {
9 | return res.json(city[req.params.province]);
10 | }
11 |
12 | export default {
13 | 'GET /api/geographic/province': getProvince,
14 | 'GET /api/geographic/city/:province': getCity,
15 | };
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/index.js:
--------------------------------------------------------------------------------
1 | import Authorized from './Authorized';
2 | import AuthorizedRoute from './AuthorizedRoute';
3 | import Secured from './Secured';
4 | import check from './CheckPermissions';
5 | import renderAuthorize from './renderAuthorize';
6 |
7 | Authorized.Secured = Secured;
8 | Authorized.AuthorizedRoute = AuthorizedRoute;
9 | Authorized.check = check;
10 |
11 | export default renderAuthorize(Authorized);
12 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/CountDown/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: CountDown
3 | subtitle: 倒计时
4 | cols: 1
5 | order: 3
6 | ---
7 |
8 | 倒计时组件。
9 |
10 | ## API
11 |
12 | | 参数 | 说明 | 类型 | 默认值 |
13 | |----------|------------------------------------------|-------------|-------|
14 | | format | 时间格式化显示 | Function(time) | |
15 | | target | 目标时间 | Date | - |
16 | | onEnd | 倒计时结束回调 | funtion | -|
17 |
--------------------------------------------------------------------------------
/book/src/main/paradox/data/index.md:
--------------------------------------------------------------------------------
1 | # 数据
2 |
3 | *本章代码见:[https://github.com/yangbajing/scala-web-development/tree/master/data](https://github.com/yangbajing/scala-web-development/tree/master/data)*
4 |
5 | @@toc { depth=2 }
6 |
7 | @@@ index
8 |
9 | * [数据](data.0.md)
10 | * [JSON](data.1.md)
11 | * [实战:为Ant.Design.Pro提供后端接口](data.ant-design-pro.md)
12 | * [Kryo](data.kryo.md)
13 | * [Protobuf](data.2.md)
14 | * [小结](data.z.md)
15 |
16 | @@@
17 |
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Bar/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IBarProps {
3 | title: React.ReactNode;
4 | color?: string;
5 | padding?: [number, number, number, number];
6 | height: number;
7 | data: Array<{
8 | x: string;
9 | y: number;
10 | }>;
11 | autoLabel?: boolean;
12 | style?: React.CSSProperties;
13 | }
14 |
15 | export default class Bar extends React.Component {}
16 |
--------------------------------------------------------------------------------
/book/src/main/paradox/basic/basic.1.md:
--------------------------------------------------------------------------------
1 | # Web 工作方式
2 |
3 | 这里,我们将主要讨论Web服务器的工作方式,Web 服务器会对 HTTP 请求进行处理并提供响应。实际的Web服务器主要会做以下这些任务:
4 |
5 | 1. **建立连接** 接受一个客户端连接,或者如果不希望与这个客户端连接则将其关闭。
6 | 2. **接收请求** 从网络中读取一条 HTTP 请求报文。
7 | 3. **处理请求** 对请求报文进行解释,并采取行动。
8 | 4. **访问资源** 访问报文中指定的资源。
9 | 5. **构建响应** 创建带有正确首部的 HTTP 响应报文。
10 | 6. **发送响应** 将响应回头给客户端。
11 | 7. **记录事务处理过程** 将与已完成事务有关的内容记录在一个日志文件中。
12 |
13 | 
14 |
15 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/CountDown/index.en-US.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: CountDown
3 | cols: 1
4 | order: 3
5 | ---
6 |
7 | Simple CountDown Component.
8 |
9 | ## API
10 |
11 | | Property | Description | Type | Default |
12 | |----------|------------------------------------------|-------------|-------|
13 | | format | Formatter of time | Function(time) | |
14 | | target | Target time | Date | - |
15 | | onEnd | Countdown to the end callback | funtion | -|
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Ellipsis/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Ellipsis
3 | subtitle: 文本自动省略号
4 | cols: 1
5 | order: 10
6 | ---
7 |
8 | 文本过长自动处理省略号,支持按照文本长度和最大行数两种方式截取。
9 |
10 | ## API
11 |
12 | 参数 | 说明 | 类型 | 默认值
13 | ----|------|-----|------
14 | tooltip | 移动到文本展示完整内容的提示 | boolean | -
15 | length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | -
16 | lines | 在按照行数截取下最大的行数,超过则截取省略 | number | `1`
17 | fullWidthRecognition | 是否将全角字符的长度视为2来计算字符串长度 | boolean | -
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Radar/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IRadarProps {
3 | title?: React.ReactNode;
4 | height: number;
5 | padding?: [number, number, number, number];
6 | hasLegend?: boolean;
7 | data: Array<{
8 | name: string;
9 | label: string;
10 | value: string;
11 | }>;
12 | style?: React.CSSProperties;
13 | }
14 |
15 | export default class Radar extends React.Component {}
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/CountDown/demo/simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本
5 | en-US: Basic
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 简单的倒计时组件使用。
11 |
12 | ## en-US
13 |
14 | The simplest usage.
15 |
16 | ````jsx
17 | import CountDown from 'ant-design-pro/lib/CountDown';
18 |
19 | const targetTime = new Date().getTime() + 3900000;
20 |
21 | ReactDOM.render(
22 |
23 | , mountNode);
24 | ````
25 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NumberInfo/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface INumberInfoProps {
3 | title?: React.ReactNode | string;
4 | subTitle?: React.ReactNode | string;
5 | total?: React.ReactNode | string;
6 | status?: 'up' | 'down';
7 | theme?: string;
8 | gap?: number;
9 | subTotal?: number;
10 | style?: React.CSSProperties;
11 | }
12 |
13 | export default class NumberInfo extends React.Component {}
14 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/defaultSettings.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | navTheme: 'dark', // theme for nav menu
3 | primaryColor: '#1890FF', // primary color of ant design
4 | layout: 'sidemenu', // nav menu position: sidemenu or topmenu
5 | contentWidth: 'Fluid', // layout of content: Fluid or Fixed, only works when layout is topmenu
6 | fixedHeader: false, // sticky header
7 | autoHideHeader: false, // auto hide header
8 | fixSiderbar: false, // sticky siderbar
9 | };
10 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/server/BaseRoute.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.server
2 |
3 | import akka.http.scaladsl.server.Directives
4 | import akka.http.scaladsl.server.Route
5 |
6 | /**
7 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-17.
8 | */
9 | trait BaseRoute extends Directives {
10 | implicit def system = Server.theSystem
11 |
12 | implicit def mat = Server.materializer
13 |
14 | implicit def ec = Server.ec
15 |
16 | def route: Route
17 | }
18 |
--------------------------------------------------------------------------------
/codes/multi-project/build.sbt:
--------------------------------------------------------------------------------
1 | name in Global := "multi-project"
2 |
3 | organization in Global := "me.yangbajing"
4 |
5 | version in Global := "0.0.1"
6 |
7 | scalaVersion in Global := "2.12.8"
8 |
9 | lazy val `multi-project-root` = project.in(file("."))
10 | .aggregate(app)
11 |
12 | lazy val app = project
13 | .dependsOn(common)
14 |
15 | lazy val common = project
16 | .settings(
17 | libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % Test
18 | )
19 |
--------------------------------------------------------------------------------
/common/src/main/scala/helloscala/http/package.scala:
--------------------------------------------------------------------------------
1 | package helloscala
2 |
3 | import akka.http.scaladsl.model.HttpRequest
4 | import akka.http.scaladsl.model.HttpResponse
5 | import akka.stream.scaladsl.SourceQueueWithComplete
6 |
7 | import scala.concurrent.Promise
8 |
9 | package object http {
10 | type HttpSourceQueue =
11 | SourceQueueWithComplete[(HttpRequest, Promise[HttpResponse])]
12 |
13 | class AkkaHttpSourceQueue(val httpSourceQueue: HttpSourceQueue)
14 | }
15 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/14.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-pages-user-register-result-registerResult .anticon{font-size:64px}.antd-pro-pages-user-register-result-registerResult .antd-pro-pages-user-register-result-title{font-size:20px;line-height:28px;margin-top:32px}.antd-pro-pages-user-register-result-registerResult .antd-pro-pages-user-register-result-actions{margin-top:40px}.antd-pro-pages-user-register-result-registerResult .antd-pro-pages-user-register-result-actions a+a{margin-left:8px}
2 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/TimelineChart/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface ITimelineChartProps {
3 | data: Array<{
4 | x: number;
5 | y1: number;
6 | y2?: number;
7 | }>;
8 | titleMap: { y1: string; y2?: string };
9 | padding?: [number, number, number, number];
10 | height?: number;
11 | style?: React.CSSProperties;
12 | }
13 |
14 | export default class TimelineChart extends React.Component {}
15 |
--------------------------------------------------------------------------------
/book/src/main/paradox/scala/scala.1.md:
--------------------------------------------------------------------------------
1 | # 你好,Scala
2 |
3 | Scala 是一门表达力很强的语言,它可以成为你工作中优秀的助手。不免俗,我们来看看 Scala 里的 helloworld:
4 |
5 | ```scala
6 | println("你好,Scala!")
7 | ```
8 |
9 | 将代码保存为 `helloworld.scala` 文件,在命令行使用以下命令直接运行(你也可以在 **REPL** 中直接输入上面代码运行)。:
10 |
11 | ```
12 | $ scala helloworld.scala
13 | $ 你好,Scala!
14 | ```
15 |
16 | Scala 可以直接执行代码文件,这个特性可以让我们使用 Scala 来写系统脚本(虽然实践中我还没这么做,因为Scala的编译、启动还是比较慢的)。我们可以
17 | 看到,代码中使用了 `println` 函数来输出字符串,这其实是对 `java.lang.System.out.println` 的封装。
18 |
--------------------------------------------------------------------------------
/foundation/src/test/scala/me/yangbajing/redis/RedisSessionTest.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing.redis
2 |
3 | import me.yangbajing.MeSpec
4 |
5 | class RedisSessionTest extends MeSpec with RedisSpec {
6 | "RedisComponentTest" should {
7 | "KV set" in {
8 | redisSession.withClient(cli => cli.set("id", "yangbajing")) shouldBe true
9 | }
10 |
11 | "KV get" in {
12 | redisSession.withClient(cli => cli.get("id")) shouldBe Some("yangbajing")
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Exception/403.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { formatMessage } from 'umi/locale';
3 | import Link from 'umi/link';
4 | import Exception from '@/components/Exception';
5 |
6 | const Exception403 = () => (
7 |
13 | );
14 |
15 | export default Exception403;
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Exception/404.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { formatMessage } from 'umi/locale';
3 | import Link from 'umi/link';
4 | import Exception from '@/components/Exception';
5 |
6 | const Exception404 = () => (
7 |
13 | );
14 |
15 | export default Exception404;
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Exception/500.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { formatMessage } from 'umi/locale';
3 | import Link from 'umi/link';
4 | import Exception from '@/components/Exception';
5 |
6 | const Exception500 = () => (
7 |
13 | );
14 |
15 | export default Exception500;
16 |
--------------------------------------------------------------------------------
/codes/multi-project/common/src/test/scala/multi/UtilsTest.scala:
--------------------------------------------------------------------------------
1 | package multi
2 |
3 | import org.scalatest.{FunSuite, Matchers}
4 |
5 | class UtilsTest extends FunSuite with Matchers {
6 |
7 | test("isBlank") {
8 | Utils.isBlank(" ") shouldBe true
9 | Utils.isBlank("") shouldBe true
10 | Utils.isBlank(null) shouldBe true
11 | Utils.isBlank("df") shouldBe false
12 | Utils.isBlank("df ") shouldBe false
13 | Utils.isBlank(" df ") shouldBe false
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/AvatarList/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import AvatarItem from './AvatarItem';
3 |
4 | export interface IAvatarListProps {
5 | size?: 'large' | 'small' | 'mini' | 'default';
6 | style?: React.CSSProperties;
7 | children: React.ReactElement | Array>;
8 | }
9 |
10 | export default class AvatarList extends React.Component {
11 | public static Item: typeof AvatarItem;
12 | }
13 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/36.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[36],{a7IW:function(e,t,a){"use strict";var n=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var d=n(a("q1tI")),i=a("LLXN"),o=n(a("mOP9")),p=n(a("luV/")),c=function(){return d.default.createElement(p.default,{type:"404",desc:(0,i.formatMessage)({id:"app.exception.description.404"}),linkElement:o.default,backText:(0,i.formatMessage)({id:"app.exception.back"})})},u=c;t.default=u}}]);
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/37.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[37],{rywk:function(e,t,a){"use strict";var n=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var d=n(a("q1tI")),i=a("LLXN"),o=n(a("mOP9")),p=n(a("luV/")),c=function(){return d.default.createElement(p.default,{type:"500",desc:(0,i.formatMessage)({id:"app.exception.description.500"}),linkElement:o.default,backText:(0,i.formatMessage)({id:"app.exception.back"})})},u=c;t.default=u}}]);
--------------------------------------------------------------------------------
/book/src/test/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | %date{"HH:mm:ss,SSS"} %5level %logger %thread [%X{akkaSource}] - %msg%n
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/foundation/src/test/scala/me/yangbajing/redis/RedisSpec.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing.redis
2 |
3 | import org.scalatest.BeforeAndAfterAll
4 | import org.scalatest.Suite
5 |
6 | /**
7 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-24.
8 | */
9 | trait RedisSpec extends BeforeAndAfterAll {
10 | this: Suite =>
11 |
12 | val redisSession = RedisSession("localhost")
13 |
14 | override protected def afterAll(): Unit = {
15 | redisSession.close()
16 | super.afterAll()
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Authorized.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import RenderAuthorized from '@/components/Authorized';
3 | import { getAuthority } from '@/utils/authority';
4 | import Redirect from 'umi/redirect';
5 |
6 | const Authority = getAuthority();
7 | const Authorized = RenderAuthorized(Authority);
8 |
9 | export default ({ children }) => (
10 | }>
11 | {children}
12 |
13 | );
14 |
--------------------------------------------------------------------------------
/book/src/main/paradox/appendix/appendix.0.md:
--------------------------------------------------------------------------------
1 | # 参考资料
2 |
3 | - Akka Doc: [http://doc.akka.io/docs/akka/2.4/scala.html](http://doc.akka.io/docs/akka/2.4/scala.html)
4 | - Akka HTTP doc: [http://doc.akka.io/docs/akka-http/current/scala/http/](http://doc.akka.io/docs/akka-http/10.0.5/scala/http/)
5 | - 《Akka in Action》:[https://www.manning.com/books/akka-in-action](https://www.manning.com/books/akka-in-action)
6 | - 《响应式架构:消息模式Actor实现与Scala、Akka应用集成》:[http://product.china-pub.com/4970527](http://product.china-pub.com/4970527)
7 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Ellipsis/index.less:
--------------------------------------------------------------------------------
1 | .ellipsis {
2 | overflow: hidden;
3 | display: inline-block;
4 | word-break: break-all;
5 | width: 100%;
6 | }
7 |
8 | .lines {
9 | position: relative;
10 | .shadow {
11 | display: block;
12 | position: absolute;
13 | color: transparent;
14 | opacity: 0;
15 | z-index: -999;
16 | }
17 | }
18 |
19 | .lineClamp {
20 | position: relative;
21 | overflow: hidden;
22 | text-overflow: ellipsis;
23 | display: -webkit-box;
24 | }
25 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Ellipsis/index.test.js:
--------------------------------------------------------------------------------
1 | import { getStrFullLength, cutStrByFullLength } from './index';
2 |
3 | describe('test calculateShowLength', () => {
4 | it('get full length', () => {
5 | expect(getStrFullLength('一二,a,')).toEqual(8);
6 | });
7 | it('cut str by full length', () => {
8 | expect(cutStrByFullLength('一二,a,', 7)).toEqual('一二,a');
9 | });
10 | it('cut str when length small', () => {
11 | expect(cutStrByFullLength('一22三', 5)).toEqual('一22');
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/route/PageRoute.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.route
2 |
3 | import akka.http.scaladsl.server.Route
4 | import akkahttp.foundation.data.domain.PageInput
5 | import helloscala.http.JacksonSupport._
6 | import akkahttp.server.BaseRoute
7 |
8 | class PageRoute extends BaseRoute {
9 | def route: Route =
10 | path("page") {
11 | post {
12 | entity(as[PageInput]) { pageInput =>
13 | complete(pageInput)
14 | }
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Ellipsis/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IEllipsisProps {
3 | tooltip?: boolean;
4 | length?: number;
5 | lines?: number;
6 | style?: React.CSSProperties;
7 | className?: string;
8 | fullWidthRecognition?: boolean;
9 | }
10 |
11 | export function getStrFullLength(str: string): number;
12 | export function cutStrByFullLength(str: string, maxLength: number): number;
13 |
14 | export default class Ellipsis extends React.Component {}
15 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Exception/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IExceptionProps {
3 | type?: '403' | '404' | '500';
4 | title?: React.ReactNode;
5 | desc?: React.ReactNode;
6 | img?: string;
7 | actions?: React.ReactNode;
8 | linkElement?: React.ReactNode;
9 | style?: React.CSSProperties;
10 | className?: string;
11 | backText?: React.ReactNode;
12 | redirect?: string;
13 | }
14 |
15 | export default class Exception extends React.Component {}
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NumberInfo/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: NumberInfo
3 | subtitle: 数据文本
4 | cols: 1
5 | order: 10
6 | ---
7 |
8 | 常用在数据卡片中,用于突出展示某个业务数据。
9 |
10 | ## API
11 |
12 | 参数 | 说明 | 类型 | 默认值
13 | ----|------|-----|------
14 | title | 标题 | ReactNode\|string | -
15 | subTitle | 子标题 | ReactNode\|string | -
16 | total | 总量 | ReactNode\|string | -
17 | subTotal | 子总量 | ReactNode\|string | -
18 | status | 增加状态 | 'up \| down' | -
19 | theme | 状态样式 | string | 'light'
20 | gap | 设置数字和描述之间的间距(像素)| number | 8
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/SettingDrawer/ThemeColor.less:
--------------------------------------------------------------------------------
1 | .themeColor {
2 | overflow: hidden;
3 | margin-top: 24px;
4 | .title {
5 | font-size: 14px;
6 | color: rgba(0, 0, 0, 0.65);
7 | line-height: 22px;
8 | margin-bottom: 12px;
9 | }
10 | .colorBlock {
11 | width: 20px;
12 | height: 20px;
13 | border-radius: 2px;
14 | float: left;
15 | cursor: pointer;
16 | margin-right: 8px;
17 | text-align: center;
18 | color: #fff;
19 | font-weight: bold;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Dashboard/Monitor.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 | @import '~@/utils/utils.less';
3 |
4 | .mapChart {
5 | padding-top: 24px;
6 | height: 457px;
7 | text-align: center;
8 | img {
9 | display: inline-block;
10 | max-width: 100%;
11 | max-height: 437px;
12 | }
13 | }
14 |
15 | .pieCard :global(.pie-stat) {
16 | font-size: 24px !important;
17 | }
18 |
19 | @media screen and (max-width: @screen-lg) {
20 | .mapChart {
21 | height: auto;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ant-design-pro/web/docker/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | ant-design-pro_build:
5 | build: ../
6 | container_name: "ant-design-pro_build"
7 | volumes:
8 | - dist:/usr/src/app/dist
9 |
10 | ant-design-pro_web:
11 | image: nginx
12 | ports:
13 | - 80:80
14 | container_name: "ant-design-pro_web"
15 | restart: unless-stopped
16 | volumes:
17 | - dist:/usr/share/nginx/html:ro
18 | - ./nginx.conf:/etc/nginx/conf.d/default.conf
19 |
20 | volumes:
21 | dist:
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/DescriptionList/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import Description from './Description';
3 |
4 | export interface IDescriptionListProps {
5 | layout?: 'horizontal' | 'vertical';
6 | col?: number;
7 | title: React.ReactNode;
8 | gutter?: number;
9 | size?: 'large' | 'small';
10 | style?: React.CSSProperties;
11 | }
12 |
13 | export default class DescriptionList extends React.Component {
14 | public static Description: typeof Description;
15 | }
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/global.less:
--------------------------------------------------------------------------------
1 | html,
2 | body,
3 | #root {
4 | height: 100%;
5 | }
6 |
7 | .colorWeak {
8 | filter: invert(80%);
9 | }
10 |
11 | .ant-layout {
12 | min-height: 100vh;
13 | }
14 |
15 | canvas {
16 | display: block;
17 | }
18 |
19 | body {
20 | text-rendering: optimizeLegibility;
21 | -webkit-font-smoothing: antialiased;
22 | -moz-osx-font-smoothing: grayscale;
23 | }
24 |
25 | .globalSpin {
26 | width: 100%;
27 | margin: 40px 0 !important;
28 | }
29 |
30 | ul,
31 | ol {
32 | list-style: none;
33 | }
34 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/document.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Ant Design Pro
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/29.chunk.css:
--------------------------------------------------------------------------------
1 | a.antd-pro-pages-list-articles-listItemMetaTitle{color:rgba(0,0,0,.85)}.antd-pro-pages-list-articles-listItemExtra{height:1px;width:272px}.antd-pro-pages-list-articles-selfTrigger{margin-left:12px}@media screen and (max-width:480px){.antd-pro-pages-list-articles-selfTrigger{display:block;margin-left:0}}@media screen and (max-width:768px){.antd-pro-pages-list-articles-selfTrigger{display:block;margin-left:0}}@media screen and (max-width:992px){.antd-pro-pages-list-articles-listItemExtra{height:1px;width:0}}
2 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/index.html:
--------------------------------------------------------------------------------
1 | Ant Design Pro
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/ChartCard/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { CardProps } from 'antd/lib/card';
3 |
4 | export interface IChartCardProps extends CardProps {
5 | title: React.ReactNode;
6 | action?: React.ReactNode;
7 | total?: React.ReactNode | number | (() => React.ReactNode | number);
8 | footer?: React.ReactNode;
9 | contentHeight?: number;
10 | avatar?: React.ReactNode;
11 | style?: React.CSSProperties;
12 | }
13 |
14 | export default class ChartCard extends React.Component {}
15 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/bar.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 4
3 | title: 柱状图
4 | ---
5 |
6 | 通过设置 `x`,`y` 属性,可以快速的构建出一个漂亮的柱状图,各种纬度的关系则是通过自定义的数据展现。
7 |
8 | ````jsx
9 | import { Bar } from 'ant-design-pro/lib/Charts';
10 |
11 | const salesData = [];
12 | for (let i = 0; i < 12; i += 1) {
13 | salesData.push({
14 | x: `${i + 1}月`,
15 | y: Math.floor(Math.random() * 1000) + 200,
16 | });
17 | }
18 |
19 | ReactDOM.render(
20 |
25 | , mountNode);
26 | ````
27 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Login/LoginSubmit.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import classNames from 'classnames';
3 | import { Button, Form } from 'antd';
4 | import styles from './index.less';
5 |
6 | const FormItem = Form.Item;
7 |
8 | const LoginSubmit = ({ className, ...rest }) => {
9 | const clsString = classNames(styles.submit, className);
10 | return (
11 |
12 |
13 |
14 | );
15 | };
16 |
17 | export default LoginSubmit;
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/tests/fix_puppeteer.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | sudo apt-get update
4 | sudo apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
5 | libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
6 | libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
7 | libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
8 | ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
9 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/tag-cloud.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 9
3 | title: 标签云
4 | ---
5 |
6 | 标签云是一套相关的标签以及与此相应的权重展示方式,一般典型的标签云有 30 至 150 个标签,而权重影响使用的字体大小或其他视觉效果。
7 |
8 | ````jsx
9 | import { TagCloud } from 'ant-design-pro/lib/Charts';
10 |
11 | const tags = [];
12 | for (let i = 0; i < 50; i += 1) {
13 | tags.push({
14 | name: `TagClout-Title-${i}`,
15 | value: Math.floor((Math.random() * 50)) + 20,
16 | });
17 | }
18 |
19 | ReactDOM.render(
20 |
24 | , mountNode);
25 | ````
26 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NoticeIcon/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .popover {
4 | width: 336px;
5 | :global(.ant-popover-inner-content) {
6 | padding: 0;
7 | }
8 | }
9 |
10 | .noticeButton {
11 | cursor: pointer;
12 | display: inline-block;
13 | transition: all 0.3s;
14 | }
15 |
16 | .icon {
17 | padding: 4px;
18 | }
19 |
20 | .tabs {
21 | :global {
22 | .ant-tabs-nav-scroll {
23 | text-align: center;
24 | }
25 | .ant-tabs-bar {
26 | margin-bottom: 4px;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/server/Server.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.server
2 |
3 | import akka.actor.ActorSystem
4 | import akka.stream.Materializer
5 | import akka.stream.Materializer
6 |
7 | import scala.concurrent.ExecutionContextExecutor
8 |
9 | /**
10 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-17.
11 | */
12 | object Server {
13 | implicit val theSystem: ActorSystem = ActorSystem("akka-http-foundation")
14 | implicit val materializer = Materializer(theSystem)
15 | implicit val ec: ExecutionContextExecutor = theSystem.dispatcher
16 | }
17 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/EditableItem/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .editableItem {
4 | line-height: @input-height-base;
5 | display: table;
6 | width: 100%;
7 | margin-top: (@font-size-base * @line-height-base - @input-height-base) / 2;
8 |
9 | .wrapper {
10 | display: table-row;
11 |
12 | & > * {
13 | display: table-cell;
14 | }
15 |
16 | & > *:first-child {
17 | width: 85%;
18 | }
19 |
20 | .icon {
21 | cursor: pointer;
22 | text-align: right;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/HeaderSearch/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IHeaderSearchProps {
3 | placeholder?: string;
4 | dataSource?: string[];
5 | defaultOpen: boolean;
6 | open: boolean;
7 | onSearch?: (value: string) => void;
8 | onChange?: (value: string) => void;
9 | onVisibleChange?: (visible: boolean) => void;
10 | onPressEnter?: (value: string) => void;
11 | style?: React.CSSProperties;
12 | className?: string;
13 | }
14 |
15 | export default class HeaderSearch extends React.Component {}
16 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/_utils/pathTools.test.js:
--------------------------------------------------------------------------------
1 | import { urlToList } from './pathTools';
2 |
3 | describe('test urlToList', () => {
4 | it('A path', () => {
5 | expect(urlToList('/userinfo')).toEqual(['/userinfo']);
6 | });
7 | it('Secondary path', () => {
8 | expect(urlToList('/userinfo/2144')).toEqual(['/userinfo', '/userinfo/2144']);
9 | });
10 | it('Three paths', () => {
11 | expect(urlToList('/userinfo/2144/addr')).toEqual([
12 | '/userinfo',
13 | '/userinfo/2144',
14 | '/userinfo/2144/addr',
15 | ]);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Exception/demo/403.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 2
3 | title:
4 | zh-CN: 403
5 | en-US: 403
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 403 页面,配合自定义操作。
11 |
12 | ## en-US
13 |
14 | 403 page with custom operations.
15 |
16 | ````jsx
17 | import Exception from 'ant-design-pro/lib/Exception';
18 | import { Button } from 'antd';
19 |
20 | const actions = (
21 |
22 |
23 |
24 |
25 | );
26 | ReactDOM.render(
27 |
28 | , mountNode);
29 | ````
30 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Exception/typeConfig.js:
--------------------------------------------------------------------------------
1 | const config = {
2 | 403: {
3 | img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg',
4 | title: '403',
5 | desc: '抱歉,你无权访问该页面',
6 | },
7 | 404: {
8 | img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg',
9 | title: '404',
10 | desc: '抱歉,你访问的页面不存在',
11 | },
12 | 500: {
13 | img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',
14 | title: '500',
15 | desc: '抱歉,服务器出错了',
16 | },
17 | };
18 |
19 | export default config;
20 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Trend/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | en-US: Trend
4 | zh-CN: Trend
5 | subtitle: 趋势标记
6 | cols: 1
7 | order: 14
8 | ---
9 |
10 | 趋势符号,标记上升和下降趋势。通常用绿色代表“好”,红色代表“不好”,股票涨跌场景除外。
11 |
12 | ## API
13 |
14 | ```html
15 | 50%
16 | ```
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | |----------|------------------------------------------|-------------|-------|
20 | | colorful | 是否彩色标记 | Boolean | true |
21 | | flag | 上升下降标识:`up|down` | string | - |
22 | | reverseColor | 颜色反转 | Boolean | false |
23 |
--------------------------------------------------------------------------------
/common/src/main/scala/helloscala/common/IntStatus.scala:
--------------------------------------------------------------------------------
1 | package helloscala.common
2 |
3 | object IntStatus {
4 | val ERROR = -1
5 | val SUCCESS = 0
6 | val OK = 200
7 | val CREATE = 201
8 | val ACCEPTED = 202
9 | val BAD_REQUEST = 400
10 | val UNAUTHORIZED = 401
11 | val NO_CONTENT = 402
12 | val FORBIDDEN = 403
13 | val NOT_FOUND = 404
14 | val NOT_FOUND_CONFIG = 404001
15 | val CONFLICT = 409
16 | val INTERNAL_ERROR = 500
17 | val NOT_IMPLEMENTED = 501
18 | val BAD_GATEWAY = 502
19 | val SERVICE_UNAVAILABLE = 503
20 | val GATEWAY_TIMEOUT = 504
21 | }
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/FooterToolbar/index.en-US.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: FooterToolbar
3 | cols: 1
4 | order: 6
5 | ---
6 |
7 | A toolbar fixed at the bottom.
8 |
9 | ## Usage
10 |
11 | It is fixed at the bottom of the content area and does not move along with the scroll bar, which is usually used for data collection and submission for long pages.
12 |
13 | ## API
14 |
15 | Property | Description | Type | Default
16 | ---------|-------------|------|--------
17 | children | toolbar content, align to the right | ReactNode | -
18 | extra | extra information, align to the left | ReactNode | -
--------------------------------------------------------------------------------
/foundation/src/main/scala/fileupload/util/Utils.scala:
--------------------------------------------------------------------------------
1 | package fileupload.util
2 | import akka.http.scaladsl.coding.Encoder
3 |
4 | object Utils {
5 | private val hexArray = "0123456789abcdef".toCharArray
6 |
7 | def bytesToHex(bytes: Array[Byte]): String = {
8 | val hexChars = new Array[Char](bytes.length * 2)
9 | var j = 0
10 | while (j < bytes.length) {
11 | val v = bytes(j) & 0xFF
12 | hexChars(j * 2) = hexArray(v >>> 4)
13 | hexChars(j * 2 + 1) = hexArray(v & 0x0F)
14 | j += 1
15 | }
16 | new String(hexChars)
17 | }
18 |
19 | Encoder
20 | }
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | jobs:
3 | build:
4 | docker:
5 | - image: circleci/node:8.11.4
6 | steps:
7 | - checkout
8 | - run: npm install
9 | - run: npm run build
10 | test:
11 | docker:
12 | - image: circleci/node:8.11.4
13 | steps:
14 | - checkout
15 | - run: sh ./tests/fix_puppeteer.sh
16 | - run: npm install
17 | - run:
18 | command : npm run test:all
19 | no_output_timeout : 30m
20 | workflows:
21 | version: 2
22 | build_and_test:
23 | jobs:
24 | - build
25 | - test
--------------------------------------------------------------------------------
/ant-design-pro/web/src/e2e/home.e2e.js:
--------------------------------------------------------------------------------
1 | import puppeteer from 'puppeteer';
2 |
3 | describe('Homepage', () => {
4 | it('it should have logo text', async () => {
5 | const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
6 | const page = await browser.newPage();
7 | await page.goto('http://localhost:8000', { waitUntil: 'networkidle2' });
8 | await page.waitForSelector('#logo h1');
9 | const text = await page.evaluate(() => document.body.innerHTML);
10 | expect(text).toContain('Ant Design Pro
');
11 | await page.close();
12 | browser.close();
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NumberInfo/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 演示
5 | en-US: Demo
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 各种数据文案的展现方式。
11 |
12 | ## en-US
13 |
14 | Used for presenting various numerical data.
15 |
16 | ````jsx
17 | import NumberInfo from 'ant-design-pro/lib/NumberInfo';
18 | import numeral from 'numeral';
19 |
20 | ReactDOM.render(
21 |
22 | Visits this week}
24 | total={numeral(12321).format('0,0')}
25 | status="up"
26 | subTotal={17.1}
27 | />
28 |
29 | , mountNode);
30 | ````
31 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Dashboard/models/monitor.js:
--------------------------------------------------------------------------------
1 | import { queryTags } from '@/services/api';
2 |
3 | export default {
4 | namespace: 'monitor',
5 |
6 | state: {
7 | tags: [],
8 | },
9 |
10 | effects: {
11 | *fetchTags(_, { call, put }) {
12 | const response = yield call(queryTags);
13 | yield put({
14 | type: 'saveTags',
15 | payload: response.list,
16 | });
17 | },
18 | },
19 |
20 | reducers: {
21 | saveTags(state, action) {
22 | return {
23 | ...state,
24 | tags: action.payload,
25 | };
26 | },
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Exception/models/error.js:
--------------------------------------------------------------------------------
1 | import queryError from '@/services/error';
2 |
3 | export default {
4 | namespace: 'error',
5 |
6 | state: {
7 | error: '',
8 | isloading: false,
9 | },
10 |
11 | effects: {
12 | *query({ payload }, { call, put }) {
13 | yield call(queryError, payload.code);
14 | yield put({
15 | type: 'trigger',
16 | payload: payload.code,
17 | });
18 | },
19 | },
20 |
21 | reducers: {
22 | trigger(state, action) {
23 | return {
24 | error: action.payload,
25 | };
26 | },
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/route/Routes.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.route
2 |
3 | import akka.http.scaladsl.model.ContentTypes
4 | import akka.http.scaladsl.model.HttpEntity
5 | import akka.http.scaladsl.server.Directives._
6 |
7 | /**
8 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-17.
9 | */
10 | class Routes {
11 | def route =
12 | path("hello") {
13 | get {
14 | complete(
15 | HttpEntity(
16 | ContentTypes.`text/html(UTF-8)`,
17 | "Say hello to akka-http
"))
18 | }
19 | } ~
20 | new PageRoute().route
21 | }
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/TagSelect/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import TagSelectOption from './TagSelectOption';
3 |
4 | export interface ITagSelectProps {
5 | onChange?: (value: string[]) => void;
6 | expandable?: boolean;
7 | value?: string[] | number[];
8 | style?: React.CSSProperties;
9 | hideCheckAll?: boolean;
10 | }
11 |
12 | export default class TagSelect extends React.Component {
13 | public static Option: typeof TagSelectOption;
14 | private children:
15 | | React.ReactElement
16 | | Array>;
17 | }
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/GlobalFooter/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .globalFooter {
4 | padding: 0 16px;
5 | margin: 48px 0 24px 0;
6 | text-align: center;
7 |
8 | .links {
9 | margin-bottom: 8px;
10 |
11 | a {
12 | color: @text-color-secondary;
13 | transition: all 0.3s;
14 |
15 | &:not(:last-child) {
16 | margin-right: 40px;
17 | }
18 |
19 | &:hover {
20 | color: @text-color;
21 | }
22 | }
23 | }
24 |
25 | .copyright {
26 | color: @text-color-secondary;
27 | font-size: @font-size-base;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本使用
5 | en-US: Basic use
6 | ---
7 |
8 | Basic use
9 |
10 | ```jsx
11 | import RenderAuthorized from 'ant-design-pro/lib/Authorized';
12 | import { Alert } from 'antd';
13 |
14 | const Authorized = RenderAuthorized('user');
15 | const noMatch = ;
16 |
17 | ReactDOM.render(
18 | ,
23 | mountNode,
24 | );
25 | ```
26 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.dockerignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | **/node_modules
5 | # roadhog-api-doc ignore
6 | /src/utils/request-temp.js
7 | _roadhog-api-doc
8 |
9 | # production
10 | /dist
11 | /.vscode
12 |
13 | # misc
14 | .DS_Store
15 | npm-debug.log*
16 | yarn-error.log
17 |
18 | /coverage
19 | .idea
20 | yarn.lock
21 | package-lock.json
22 | *bak
23 | .vscode
24 |
25 | # visual studio code
26 | .history
27 | *.log
28 |
29 | functions/mock
30 | .temp/**
31 |
32 | # umi
33 | .umi
34 | .umi-production
35 |
36 | # screenshot
37 | screenshot
38 | .firebase
--------------------------------------------------------------------------------
/ant-design-pro/web/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | **/node_modules
5 | # roadhog-api-doc ignore
6 | /src/utils/request-temp.js
7 | _roadhog-api-doc
8 |
9 | # production
10 | /dist
11 | /.vscode
12 |
13 | # misc
14 | .DS_Store
15 | npm-debug.log*
16 | yarn-error.log
17 |
18 | /coverage
19 | .idea
20 | yarn.lock
21 | package-lock.json
22 | *bak
23 | .vscode
24 |
25 | # visual studio code
26 | .history
27 | *.log
28 |
29 | functions/mock
30 | .temp/**
31 |
32 | # umi
33 | .umi
34 | .umi-production
35 |
36 | # screenshot
37 | screenshot
38 | .firebase
39 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/demo/secured.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 3
3 | title:
4 | zh-CN: 注解基本使用
5 | en-US: Basic use secured
6 | ---
7 |
8 | secured demo used
9 |
10 | ```jsx
11 | import RenderAuthorized from 'ant-design-pro/lib/Authorized';
12 | import { Alert } from 'antd';
13 |
14 | const { Secured } = RenderAuthorized('user');
15 |
16 | @Secured('admin')
17 | class TestSecuredString extends React.Component {
18 | render() {
19 | ;
20 | }
21 | }
22 | ReactDOM.render(
23 |
24 |
25 |
,
26 | mountNode,
27 | );
28 | ```
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageHeader/demo/simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 3
3 | title: Simple
4 | ---
5 |
6 | 简单的页头。
7 |
8 | ````jsx
9 | import PageHeader from 'ant-design-pro/lib/PageHeader';
10 |
11 | const breadcrumbList = [{
12 | title: '一级菜单',
13 | href: '/',
14 | }, {
15 | title: '二级菜单',
16 | href: '/',
17 | }, {
18 | title: '三级菜单',
19 | }];
20 |
21 | ReactDOM.render(
22 |
25 | , mountNode);
26 | ````
27 |
28 |
33 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/ActiveChart/index.less:
--------------------------------------------------------------------------------
1 | .activeChart {
2 | position: relative;
3 | }
4 | .activeChartGrid {
5 | p {
6 | position: absolute;
7 | top: 80px;
8 | }
9 | p:last-child {
10 | top: 115px;
11 | }
12 | }
13 | .activeChartLegend {
14 | position: relative;
15 | font-size: 0;
16 | margin-top: 8px;
17 | height: 20px;
18 | line-height: 20px;
19 | span {
20 | display: inline-block;
21 | font-size: 12px;
22 | text-align: center;
23 | width: 33.33%;
24 | }
25 | span:first-child {
26 | text-align: left;
27 | }
28 | span:last-child {
29 | text-align: right;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/AuthorizedRoute.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Route, Redirect } from 'react-router-dom';
3 | import Authorized from './Authorized';
4 |
5 | // TODO: umi只会返回render和rest
6 | const AuthorizedRoute = ({ component: Component, render, authority, redirectPath, ...rest }) => (
7 | } />}
10 | >
11 | (Component ? : render(props))} />
12 |
13 | );
14 |
15 | export default AuthorizedRoute;
16 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/24.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-components-footer-toolbar-index-toolbar{background:#fff;border-top:1px solid #e8e8e8;bottom:0;box-shadow:0 -1px 2px rgba(0,0,0,.03);height:56px;line-height:56px;padding:0 24px;position:fixed;right:0;width:100%;z-index:9}.antd-pro-components-footer-toolbar-index-toolbar:after{clear:both;content:"";display:block}.antd-pro-components-footer-toolbar-index-toolbar .antd-pro-components-footer-toolbar-index-left{float:left}.antd-pro-components-footer-toolbar-index-toolbar .antd-pro-components-footer-toolbar-index-right{float:right}.antd-pro-components-footer-toolbar-index-toolbar button+button{margin-left:8px}
2 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/HeaderSearch/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | en-US: HeaderSearch
4 | zh-CN: HeaderSearch
5 | subtitle: 顶部搜索框
6 | cols: 1
7 | order: 8
8 | ---
9 |
10 | 通常作为全局搜索的入口,放置在导航工具条右侧。
11 |
12 | ## API
13 |
14 | 参数 | 说明 | 类型 | 默认值
15 | ----|------|-----|------
16 | placeholder | 占位文字 | string | -
17 | dataSource | 当前提示内容列表 | string[] | -
18 | onSearch | 选择某项或按下回车时的回调 | function(value) | -
19 | onChange | 输入搜索字符的回调 | function(value) | -
20 | onPressEnter | 按下回车时的回调 | function(value) | -
21 | onVisibleChange | 显示或隐藏文本框的回调 | function(value) |-
22 | defaultOpen | 输入框首次显示是否显示 | boolean | false
23 | open | 控制输入框是否显示 | booelan |false
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageHeaderWrapper/GridContent.js:
--------------------------------------------------------------------------------
1 | import React, { PureComponent } from 'react';
2 | import { connect } from 'dva';
3 | import styles from './GridContent.less';
4 |
5 | class GridContent extends PureComponent {
6 | render() {
7 | const { contentWidth, children } = this.props;
8 | let className = `${styles.main}`;
9 | if (contentWidth === 'Fixed') {
10 | className = `${styles.main} ${styles.wide}`;
11 | }
12 | return {children}
;
13 | }
14 | }
15 |
16 | export default connect(({ setting }) => ({
17 | contentWidth: setting.contentWidth,
18 | }))(GridContent);
19 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Result/demo/structure.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title: Structure
4 | ---
5 |
6 | 结构包含 `处理结果`,`补充信息` 以及 `操作建议` 三个部分,其中 `处理结果` 由 `提示图标`,`标题` 和 `结果描述` 组成。
7 |
8 | ````jsx
9 | import Result from 'ant-design-pro/lib/Result';
10 |
11 | ReactDOM.render(
12 | 标题}
15 | description={结果描述
}
16 | extra="其他补充信息,自带灰底效果"
17 | actions={操作建议,一般放置按钮组
}
18 | />
19 | , mountNode);
20 | ````
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/models/project.js:
--------------------------------------------------------------------------------
1 | import { queryProjectNotice } from '@/services/api';
2 |
3 | export default {
4 | namespace: 'project',
5 |
6 | state: {
7 | notice: [],
8 | },
9 |
10 | effects: {
11 | *fetchNotice(_, { call, put }) {
12 | const response = yield call(queryProjectNotice);
13 | yield put({
14 | type: 'saveNotice',
15 | payload: Array.isArray(response) ? response : [],
16 | });
17 | },
18 | },
19 |
20 | reducers: {
21 | saveNotice(state, action) {
22 | return {
23 | ...state,
24 | notice: action.payload,
25 | };
26 | },
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Result/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | en-US: Result
4 | zh-CN: Result
5 | subtitle: 处理结果
6 | cols: 1
7 | order: 12
8 | ---
9 |
10 | 结果页用于对用户进行的一系列任务处理结果进行反馈。
11 |
12 | ## API
13 |
14 | | 参数 | 说明 | 类型 | 默认值 |
15 | |----------|------------------------------------------|-------------|-------|
16 | | type | 类型,不同类型自带对应的图标 | Enum {'success', 'error'} | - |
17 | | title | 标题 | ReactNode | - |
18 | | description | 结果描述 | ReactNode | - |
19 | | extra | 补充信息,有默认的灰色背景 | ReactNode | - |
20 | | actions | 操作建议,推荐放置跳转链接,按钮组等 | ReactNode | - |
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Dashboard/models/activities.js:
--------------------------------------------------------------------------------
1 | import { queryActivities } from '@/services/api';
2 |
3 | export default {
4 | namespace: 'activities',
5 |
6 | state: {
7 | list: [],
8 | },
9 |
10 | effects: {
11 | *fetchList(_, { call, put }) {
12 | const response = yield call(queryActivities);
13 | yield put({
14 | type: 'saveList',
15 | payload: Array.isArray(response) ? response : [],
16 | });
17 | },
18 | },
19 |
20 | reducers: {
21 | saveList(state, action) {
22 | return {
23 | ...state,
24 | list: action.payload,
25 | };
26 | },
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/MiniArea/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | // g2已经更新到3.0
4 | // 不带的写了
5 |
6 | export interface IAxis {
7 | title: any;
8 | line: any;
9 | gridAlign: any;
10 | labels: any;
11 | tickLine: any;
12 | grid: any;
13 | }
14 |
15 | export interface IMiniAreaProps {
16 | color?: string;
17 | height: number;
18 | borderColor?: string;
19 | line?: boolean;
20 | animate?: boolean;
21 | xAxis?: IAxis;
22 | yAxis?: IAxis;
23 | data: Array<{
24 | x: number | string;
25 | y: number;
26 | }>;
27 | }
28 |
29 | export default class MiniArea extends React.Component {}
30 |
--------------------------------------------------------------------------------
/common/src/main/scala/com/typesafe/config/impl/ConfigurationHelper.scala:
--------------------------------------------------------------------------------
1 | package com.typesafe.config.impl
2 |
3 | import java.util.Properties
4 |
5 | import com.typesafe.config.ConfigFactory
6 | import com.typesafe.config.ConfigParseOptions
7 | import helloscala.common.Configuration
8 |
9 | object ConfigurationHelper {
10 | def fromProperties(props: Properties): Configuration = {
11 | ConfigFactory.systemProperties()
12 | val config =
13 | Parseable
14 | .newProperties(props, ConfigParseOptions.defaults())
15 | .parse()
16 | .asInstanceOf[AbstractConfigObject]
17 | .toConfig
18 | Configuration(config)
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NumberInfo/index.en-US.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: NumberInfo
3 | cols: 1
4 | order: 10
5 | ---
6 |
7 | Often used in data cards for highlighting the business data.
8 |
9 | ## API
10 |
11 | Property | Description | Type | Default
12 | ----|------|-----|------
13 | title | title | ReactNode\|string | -
14 | subTitle | subtitle | ReactNode\|string | -
15 | total | total amount | ReactNode\|string | -
16 | subTotal | total amount of additional information | ReactNode\|string | -
17 | status | increase state | 'up \| down' | -
18 | theme | state style | string | 'light'
19 | gap | set the spacing (pixels) between numbers and descriptions | number | 8
20 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/8.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[8],{"+LeE":function(e,t,a){"use strict";var s=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=s(a("MVZn")),r=s(a("o0o1")),u=a("dCQc"),c={namespace:"monitor",state:{tags:[]},effects:{fetchTags:r.default.mark(function e(t,a){var s,n,c;return r.default.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return s=a.call,n=a.put,e.next=3,s(u.queryTags);case 3:return c=e.sent,e.next=6,n({type:"saveTags",payload:c.list});case 6:case"end":return e.stop()}},e,this)})},reducers:{saveTags:function(e,t){return(0,n.default)({},e,{tags:t.payload})}}};t.default=c}}]);
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/mini-area.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 2
3 | col: 2
4 | title: 迷你区域图
5 | ---
6 |
7 | ````jsx
8 | import { MiniArea } from 'ant-design-pro/lib/Charts';
9 | import moment from 'moment';
10 |
11 | const visitData = [];
12 | const beginDay = new Date().getTime();
13 | for (let i = 0; i < 20; i += 1) {
14 | visitData.push({
15 | x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
16 | y: Math.floor(Math.random() * 100) + 10,
17 | });
18 | }
19 |
20 | ReactDOM.render(
21 |
27 | , mountNode);
28 | ````
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/List/Articles.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | a.listItemMetaTitle {
4 | color: @heading-color;
5 | }
6 | .listItemExtra {
7 | width: 272px;
8 | height: 1px;
9 | }
10 | .selfTrigger {
11 | margin-left: 12px;
12 | }
13 |
14 | @media screen and (max-width: @screen-xs) {
15 | .selfTrigger {
16 | display: block;
17 | margin-left: 0;
18 | }
19 | }
20 | @media screen and (max-width: @screen-md) {
21 | .selfTrigger {
22 | display: block;
23 | margin-left: 0;
24 | }
25 | }
26 | @media screen and (max-width: @screen-lg) {
27 | .listItemExtra {
28 | width: 0;
29 | height: 1px;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/demo/AuthorizedArray.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: 使用数组作为参数
5 | en-US: Use Array as a parameter
6 | ---
7 |
8 | Use Array as a parameter
9 |
10 | ```jsx
11 | import RenderAuthorized from 'ant-design-pro/lib/Authorized';
12 | import { Alert } from 'antd';
13 |
14 | const Authorized = RenderAuthorized('user');
15 | const noMatch = ;
16 |
17 | ReactDOM.render(
18 |
19 |
20 | ,
21 | mountNode,
22 | );
23 | ```
24 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/User/Login.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .main {
4 | width: 368px;
5 | margin: 0 auto;
6 | @media screen and (max-width: @screen-sm) {
7 | width: 95%;
8 | }
9 |
10 | .icon {
11 | font-size: 24px;
12 | color: rgba(0, 0, 0, 0.2);
13 | margin-left: 16px;
14 | vertical-align: middle;
15 | cursor: pointer;
16 | transition: color 0.3s;
17 |
18 | &:hover {
19 | color: @primary-color;
20 | }
21 | }
22 |
23 | .other {
24 | text-align: left;
25 | margin-top: 24px;
26 | line-height: 22px;
27 |
28 | .register {
29 | float: right;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/docs/lib/prettify/prettify.css:
--------------------------------------------------------------------------------
1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/FooterToolbar/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .toolbar {
4 | position: fixed;
5 | width: 100%;
6 | bottom: 0;
7 | right: 0;
8 | height: 56px;
9 | line-height: 56px;
10 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03);
11 | background: #fff;
12 | border-top: 1px solid @border-color-split;
13 | padding: 0 24px;
14 | z-index: 9;
15 |
16 | &:after {
17 | content: '';
18 | display: block;
19 | clear: both;
20 | }
21 |
22 | .left {
23 | float: left;
24 | }
25 |
26 | .right {
27 | float: right;
28 | }
29 |
30 | button + button {
31 | margin-left: 8px;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/ArticleListContent/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import moment from 'moment';
3 | import { Avatar } from 'antd';
4 | import styles from './index.less';
5 |
6 | const ArticleListContent = ({ data: { content, updatedAt, avatar, owner, href } }) => (
7 |
8 |
{content}
9 |
10 |
11 |
{owner} 发布在
{href}
12 |
{moment(updatedAt).format('YYYY-MM-DD HH:mm')}
13 |
14 |
15 | );
16 |
17 | export default ArticleListContent;
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/AvatarList/demo/simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基础样例
5 | en-US: Basic Usage
6 | ---
7 |
8 | Simplest of usage.
9 |
10 | ````jsx
11 | import AvatarList from 'ant-design-pro/lib/AvatarList';
12 |
13 | ReactDOM.render(
14 |
15 |
16 |
17 |
18 |
19 | , mountNode);
20 | ````
21 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/mini-bar.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 2
3 | col: 2
4 | title: 迷你柱状图
5 | ---
6 |
7 | 迷你柱状图更适合展示简单的区间数据,简洁的表现方式可以很好的减少大数据量的视觉展现压力。
8 |
9 | ````jsx
10 | import { MiniBar } from 'ant-design-pro/lib/Charts';
11 | import moment from 'moment';
12 |
13 | const visitData = [];
14 | const beginDay = new Date().getTime();
15 | for (let i = 0; i < 20; i += 1) {
16 | visitData.push({
17 | x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'),
18 | y: Math.floor(Math.random() * 100) + 10,
19 | });
20 | }
21 |
22 | ReactDOM.render(
23 |
27 | , mountNode);
28 | ````
29 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/me/yangbajing/redis/RedisSession.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing.redis
2 |
3 | import com.redis.RedisClient
4 | import com.redis.RedisClientPool
5 |
6 | /**
7 | * Redis访问组件
8 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-24.
9 | */
10 | class RedisSession(val pool: RedisClientPool) {
11 | def withClient[T](body: RedisClient => T): T = pool.withClient(body)
12 |
13 | def close(): Unit = pool.close
14 |
15 | override def toString: String = pool.host + ":" + String.valueOf(pool.port)
16 | }
17 |
18 | object RedisSession {
19 | def apply(host: String, port: Int = 6379): RedisSession =
20 | new RedisSession(new RedisClientPool(host, port))
21 | }
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NoticeIcon/NoticeIconTab.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface INoticeIconData {
3 | avatar?: string|React.ReactNode;
4 | title?: React.ReactNode;
5 | description?: React.ReactNode;
6 | datetime?: React.ReactNode;
7 | extra?: React.ReactNode;
8 | style?: React.CSSProperties;
9 | }
10 |
11 | export interface INoticeIconTabProps {
12 | list?: INoticeIconData[];
13 | title?: string;
14 | name?: string;
15 | emptyText?: React.ReactNode;
16 | emptyImage?: string;
17 | style?: React.CSSProperties;
18 | showClear?: boolean;
19 | }
20 |
21 | export default class NoticeIconTab extends React.Component {}
22 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/6.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[6],{IyzB:function(e,t,a){"use strict";var s=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=s(a("MVZn")),n=s(a("o0o1")),i=a("dCQc"),c={namespace:"activities",state:{list:[]},effects:{fetchList:n.default.mark(function e(t,a){var s,r,c;return n.default.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return s=a.call,r=a.put,e.next=3,s(i.queryActivities);case 3:return c=e.sent,e.next=6,r({type:"saveList",payload:Array.isArray(c)?c:[]});case 6:case"end":return e.stop()}},e,this)})},reducers:{saveList:function(e,t){return(0,r.default)({},e,{list:t.payload})}}};t.default=c}}]);
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/WaterWave/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .waterWave {
4 | display: inline-block;
5 | position: relative;
6 | transform-origin: left;
7 | .text {
8 | position: absolute;
9 | left: 0;
10 | top: 32px;
11 | text-align: center;
12 | width: 100%;
13 | span {
14 | color: @text-color-secondary;
15 | font-size: 14px;
16 | line-height: 22px;
17 | }
18 | h4 {
19 | color: @heading-color;
20 | line-height: 32px;
21 | font-size: 24px;
22 | }
23 | }
24 | .waterWaveCanvasWrapper {
25 | transform: scale(0.5);
26 | transform-origin: 0 0;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/utils/Yuan.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { yuan } from '@/components/Charts';
3 | /**
4 | * 减少使用 dangerouslySetInnerHTML
5 | */
6 | export default class Yuan extends React.PureComponent {
7 | componentDidMount() {
8 | this.rendertoHtml();
9 | }
10 |
11 | componentDidUpdate() {
12 | this.rendertoHtml();
13 | }
14 |
15 | rendertoHtml = () => {
16 | const { children } = this.props;
17 | if (this.main) {
18 | this.main.innerHTML = yuan(children);
19 | }
20 | };
21 |
22 | render() {
23 | return (
24 | {
26 | this.main = ref;
27 | }}
28 | />
29 | );
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/book/src/main/paradox/index.md:
--------------------------------------------------------------------------------
1 | # Scala Web 开发——基于Akka HTTP
2 |
3 | *Akka HTTP*
4 |
5 | @@toc { depth=3 }
6 |
7 | @@@ index
8 |
9 | * [preface](preface.md)
10 | * [env](env/index.md)
11 | * [scala](scala/index.md)
12 | * [basic](basic/index.md)
13 | * [server-api](server-api/index.md)
14 | - [routing-dsl](routing-dsl/index.md)
15 | - [directives](directives/index.md)
16 | * [data](data/index.md)
17 | * [test](test/index.md)
18 | * [actor](actor/index.md)
19 | * [oauth](oauth/index.md)
20 | * [database](database/index.md)
21 | * [engineering](engineering/index.md)
22 | * [config-discovery](config-discovery/index.md)
23 | * [appendix](appendix/index.md)
24 | * [donate](donate.md)
25 |
26 | @@@
27 |
28 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/Pie/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IPieProps {
3 | animate?: boolean;
4 | color?: string;
5 | colors?: string[];
6 | height: number;
7 | hasLegend?: boolean;
8 | padding?: [number, number, number, number];
9 | percent?: number;
10 | data?: Array<{
11 | x: string | string;
12 | y: number;
13 | }>;
14 | total?: React.ReactNode | number | (() => React.ReactNode | number);
15 | title?: React.ReactNode;
16 | tooltip?: boolean;
17 | valueFormat?: (value: string) => string | React.ReactNode;
18 | subTitle?: React.ReactNode;
19 | }
20 |
21 | export default class Pie extends React.Component {}
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Ellipsis/index.en-US.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Ellipsis
3 | cols: 1
4 | order: 10
5 | ---
6 |
7 | When the text is too long, the Ellipsis automatically shortens it according to its length or the maximum number of lines.
8 |
9 | ## API
10 |
11 | Property | Description | Type | Default
12 | ----|------|-----|------
13 | tooltip | tooltip for showing the full text content when hovering over | boolean | -
14 | length | maximum number of characters in the text before being truncated | number | -
15 | lines | maximum number of rows in the text before being truncated | number | `1`
16 | fullWidthRecognition | whether consider full-width character length as 2 when calculate string length | boolean | -
17 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/fileupload/service/FileService.scala:
--------------------------------------------------------------------------------
1 | package fileupload.service
2 |
3 | import akka.actor.ActorSystem
4 | import akka.http.scaladsl.model.Multipart
5 | import akka.stream.Materializer
6 | import fileupload.model.FileBO
7 | import fileupload.model.FileMeta
8 |
9 | import scala.concurrent.Future
10 |
11 | trait FileService {
12 | implicit val system: ActorSystem
13 | implicit val mat: Materializer
14 |
15 | def progressByHash(hash: String): Future[Option[FileMeta]]
16 |
17 | def handleUpload(formData: Multipart.FormData): Future[Seq[FileBO]]
18 | }
19 |
20 | object FileService {
21 | def apply(system: ActorSystem, mat: Materializer) =
22 | new FileServiceImpl(system, mat)
23 | }
24 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/DescriptionList/Description.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Col } from 'antd';
4 | import styles from './index.less';
5 | import responsive from './responsive';
6 |
7 | const Description = ({ term, column, children, ...restProps }) => (
8 |
9 | {term && {term}
}
10 | {children !== null && children !== undefined && {children}
}
11 |
12 | );
13 |
14 | Description.defaultProps = {
15 | term: '',
16 | };
17 |
18 | Description.propTypes = {
19 | term: PropTypes.node,
20 | };
21 |
22 | export default Description;
23 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/utils/authority.test.js:
--------------------------------------------------------------------------------
1 | import { getAuthority } from './authority';
2 |
3 | describe('getAuthority should be strong', () => {
4 | it('empty', () => {
5 | expect(getAuthority(null)).toEqual(['admin']); // default value
6 | });
7 | it('string', () => {
8 | expect(getAuthority('admin')).toEqual(['admin']);
9 | });
10 | it('array with double quotes', () => {
11 | expect(getAuthority('"admin"')).toEqual(['admin']);
12 | });
13 | it('array with single item', () => {
14 | expect(getAuthority('["admin"]')).toEqual(['admin']);
15 | });
16 | it('array with multiple items', () => {
17 | expect(getAuthority('["admin", "guest"]')).toEqual(['admin', 'guest']);
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/timeline-chart.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 9
3 | title: 带有时间轴的图表
4 | ---
5 |
6 | 使用 `TimelineChart` 组件可以实现带有时间轴的柱状图展现,而其中的 `x` 属性,则是时间值的指向,默认最多支持同时展现两个指标,分别是 `y1` 和 `y2`。
7 |
8 | ````jsx
9 | import { TimelineChart } from 'ant-design-pro/lib/Charts';
10 |
11 | const chartData = [];
12 | for (let i = 0; i < 20; i += 1) {
13 | chartData.push({
14 | x: (new Date().getTime()) + (1000 * 60 * 30 * i),
15 | y1: Math.floor(Math.random() * 100) + 1000,
16 | y2: Math.floor(Math.random() * 100) + 10,
17 | });
18 | }
19 |
20 | ReactDOM.render(
21 |
26 | , mountNode);
27 | ````
28 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/AvatarList/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: AvatarList
3 | subtitle: 用户头像列表
4 | order: 1
5 | cols: 1
6 | ---
7 |
8 | 一组用户头像,常用在项目/团队成员列表。可通过设置 `size` 属性来指定头像大小。
9 |
10 | ## API
11 |
12 | ### AvatarList
13 |
14 | | 参数 | 说明 | 类型 | 默认值 |
15 | |----------|------------------------------------------|-------------|-------|
16 | | size | 头像大小 | `large`、`small` 、`mini`, `default` | `default` |
17 |
18 | ### AvatarList.Item
19 |
20 | | 参数 | 说明 | 类型 | 默认值 |
21 | |----------|------------------------------------------|-------------|-------|
22 | | tips | 头像展示文案 | ReactNode\/string | - |
23 | | src | 头像图片连接 | string | - |
24 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/TagSelect/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .tagSelect {
4 | user-select: none;
5 | margin-left: -8px;
6 | position: relative;
7 | overflow: hidden;
8 | max-height: 32px;
9 | line-height: 32px;
10 | transition: all 0.3s;
11 | :global {
12 | .ant-tag {
13 | padding: 0 8px;
14 | margin-right: 24px;
15 | font-size: @font-size-base;
16 | }
17 | }
18 | &.expanded {
19 | transition: all 0.3s;
20 | max-height: 200px;
21 | }
22 | .trigger {
23 | position: absolute;
24 | top: 0;
25 | right: 0;
26 | i {
27 | font-size: 12px;
28 | }
29 | }
30 | &.hasExpandTag {
31 | padding-right: 50px;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/book/src/main/paradox/examples/example.md:
--------------------------------------------------------------------------------
1 |
2 | ```scala
3 |
4 | val HEADER_KEYS = Set("api-id", "user-id", "org-id")
5 |
6 | def generateHeaders: Directive1[Map[String, String]] =
7 | extractRequest.flatMap { request =>
8 | val headerMap = request.headers
9 | .filter(header => HEADER_KEYS.contains(header.lowercaseName()))
10 | .map(header => header.lowercaseName() -> header.value())
11 | .toMap
12 | if (true) provide(headerMap)
13 | else reject(ForbiddenRejection("用户认证失败"))
14 | }
15 |
16 | def testRoute = generateHeaders { reqHeaders =>
17 | messageRoute(reqHeaders)
18 | }
19 |
20 | def messageRoute(reqHeaders: Map[String, String]): Route = {
21 | completeOk
22 | }
23 |
24 | ```
--------------------------------------------------------------------------------
/common/src/test/scala/helloscala/test/HelloscalaSpec.scala:
--------------------------------------------------------------------------------
1 | package helloscala.test
2 |
3 | import org.scalatest.EitherValues
4 | import org.scalatest.Matchers
5 | import org.scalatest.Matchers
6 | import org.scalatest.OptionValues
7 | import org.scalatest.WordSpecLike
8 | import org.scalatest.concurrent.ScalaFutures
9 | import org.scalatest.time.Milliseconds
10 | import org.scalatest.time.Seconds
11 | import org.scalatest.time.Span
12 |
13 | trait FusionTestWordSpec extends WordSpecLike with OptionValues with EitherValues
14 |
15 | trait HelloscalaSpec extends FusionTestWordSpec with ScalaFutures with Matchers {
16 | implicit override val patienceConfig: PatienceConfig =
17 | PatienceConfig(Span(60, Seconds), Span(200, Milliseconds))
18 | }
19 |
--------------------------------------------------------------------------------
/book/src/main/paradox/scala/scala.0.md:
--------------------------------------------------------------------------------
1 | # REPL
2 |
3 | 有两种启动 **REPL** 的方式,一种是直接运行 `scala` 命令:
4 |
5 | ```
6 | cd $SCALA_HOME
7 | ./bin/scala
8 | ```
9 |
10 | 还有种是在 Sbt工程登录进入 **Sbt Console**:
11 |
12 | ```
13 | sbt console
14 | ```
15 |
16 | 或者在进入 Sbt 交互式控制台后再执行 `console` 命令。
17 |
18 | 启动Scala REPL,它是一个基于命令行的交互式编程环境。对于有着Python、Ruby等动态语言的同学来说,这是一个很常用和工具。但Javaer
19 | 们第一次见到会觉得比较神奇。我们可以在REPL中做一些代码尝试而不用启动笨拙的IDE,这在我们思考问题时非常的方便。对于Javaer有一个好消息,JDK 9开
20 | 始将内建支持REPL功能。
21 |
22 | ```
23 | sbt:scala-seed> console
24 | [info] Starting scala interpreter...
25 | Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_151).
26 | Type in expressions for evaluation. Or try :help.
27 |
28 | scala>
29 | ```
30 |
31 | 接下来我们将在 Scala REPL 中测试本章的示例代码。
32 |
--------------------------------------------------------------------------------
/foundation/src/test/scala/me/yangbajing/cassandra/CassandraSpec.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing.cassandra
2 |
3 | import org.scalatest.BeforeAndAfterAll
4 | import org.scalatest.Suite
5 |
6 | /**
7 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-24.
8 | */
9 | trait CassandraSpec extends BeforeAndAfterAll {
10 | this: Suite =>
11 |
12 | var cassandraSession: CassandraSession = _
13 |
14 | override protected def beforeAll(): Unit = {
15 | super.beforeAll()
16 | val cluster = CassandraHelper.getCluster(Seq("localhost"))
17 | cassandraSession = new CassandraSession(cluster)
18 | }
19 |
20 | override def afterAll(): Unit = {
21 | cassandraSession.close()
22 | //dataSource
23 | super.afterAll()
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Trend/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .trendItem {
4 | display: inline-block;
5 | font-size: @font-size-base;
6 | line-height: 22px;
7 |
8 | .up,
9 | .down {
10 | margin-left: 4px;
11 | position: relative;
12 | top: 1px;
13 | i {
14 | font-size: 12px;
15 | transform: scale(0.83);
16 | }
17 | }
18 | .up {
19 | color: @red-6;
20 | }
21 | .down {
22 | color: @green-6;
23 | top: -1px;
24 | }
25 |
26 | &.trendItemGrey .up,
27 | &.trendItemGrey .down {
28 | color: @text-color;
29 | }
30 |
31 | &.reverseColor .up {
32 | color: @green-6;
33 | }
34 | &.reverseColor .down {
35 | color: @red-6;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ant-design-pro/web/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:latest
2 |
3 | WORKDIR /usr/src/app/
4 |
5 | COPY package.json ./
6 | RUN npm install --silent --no-cache
7 |
8 | COPY ./ ./
9 |
10 | RUN apt-get update
11 | RUN apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
12 | libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
13 | libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
14 | libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
15 | ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
16 |
17 | RUN npm run test:all
18 |
19 | CMD ["npm", "run", "build"]
20 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Exception/index.zh-CN.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Exception
3 | subtitle: 异常
4 | cols: 1
5 | order: 5
6 | ---
7 |
8 | 异常页用于对页面特定的异常状态进行反馈。通常,它包含对错误状态的阐述,并向用户提供建议或操作,避免用户感到迷失和困惑。
9 |
10 | ## API
11 |
12 | | 参数 | 说明| 类型 | 默认值 |
13 | |-------------|------------------------------------------|-------------|-------|
14 | | backText| 默认的返回按钮文本 | ReactNode| back to home |
15 | | type| 页面类型,若配置,则自带对应类型默认的 `title`,`desc`,`img`,此默认设置可以被 `title`,`desc`,`img` 覆盖 | Enum {'403', '404', '500'} | - |
16 | | title | 标题 | ReactNode| -|
17 | | desc| 补充描述| ReactNode| -|
18 | | img | 背景图片地址 | string| -|
19 | | actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -|
20 | | linkElement | 定义链接的元素 | string\|ReactElement | 'a' |
21 | | redirect | 返回按钮的跳转地址 | string | '/'
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/functions/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "functions",
3 | "description": "Cloud Functions for Firebase",
4 | "scripts": {
5 | "serve": "npm run mock && firebase serve --only functions",
6 | "shell": "firebase functions:shell",
7 | "start": "npm run shell",
8 | "deploy": "firebase deploy --only functions",
9 | "logs": "firebase functions:log",
10 | "mock": "node ../scripts/generateMock.js"
11 | },
12 | "dependencies": {
13 | "@babel/runtime": "^7.0.0",
14 | "body-parser": "^1.18.3",
15 | "express": "^4.16.3",
16 | "firebase-admin": "^5.12.1",
17 | "firebase-functions": "^2.0.5",
18 | "mockjs": "^1.0.1-beta3",
19 | "moment": "^2.22.2",
20 | "path-to-regexp": "^2.2.1"
21 | },
22 | "private": true
23 | }
24 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/StandardFormRow/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import classNames from 'classnames';
3 | import styles from './index.less';
4 |
5 | const StandardFormRow = ({ title, children, last, block, grid, ...rest }) => {
6 | const cls = classNames(styles.standardFormRow, {
7 | [styles.standardFormRowBlock]: block,
8 | [styles.standardFormRowLast]: last,
9 | [styles.standardFormRowGrid]: grid,
10 | });
11 |
12 | return (
13 |
14 | {title && (
15 |
16 | {title}
17 |
18 | )}
19 |
{children}
20 |
21 | );
22 | };
23 |
24 | export default StandardFormRow;
25 |
--------------------------------------------------------------------------------
/book/src/main/paradox/data/data.kryo.md:
--------------------------------------------------------------------------------
1 | # Kryo
2 |
3 | Kryo是一种快速高效的用于Java的二进制对象图序列化框架。具有调整、压缩率高和易于使用的特性。
4 |
5 | 在Akka中使用Kryo可以采用Twitter开源的 [chill](https://github.com/twitter/chill) 库,它可以简化对Kryo的使用并对Scala有着更友好的API。
6 |
7 | 在Akka里使用`chill`非常的简单,首先需要引入相关库依赖:
8 | ```scala
9 | libraryDependencies += "com.twitter" %% "chill-akka" % "0.9.3"
10 | ```
11 |
12 | 在修改Akka配置:
13 | ```
14 | akka.actor {
15 | # 启用附加的自定义序列化绑定功能
16 | enable-additional-serialization-bindings = on
17 |
18 | # 禁用Java默认序列化功能
19 | allow-java-serialization = off
20 |
21 | serializers {
22 | kryo = "com.twitter.chill.akka.AkkaSerializer"
23 | }
24 |
25 | serialization-bindings {
26 | # 指定所有实现了`java.io.Serializable`接口的类都使用 kryo 序列化
27 | "java.io.Serializable" = kryo
28 | }
29 | }
30 | ```
31 |
--------------------------------------------------------------------------------
/config-discovery/src/multi-jvm/resources/application.conf:
--------------------------------------------------------------------------------
1 | include "fusion-discovery-server.conf"
2 | #akka.cluster.distributed-data.durable.keys = ["*"]
3 | akka.cluster.distributed-data.durable.lmdb.write-behind-interval = 200 ms
4 | #akka.cluster.distributed-data.durable.lmdb.dir = "fusion-discovery"
5 | akka.persistence {
6 | #journal.plugin = "cassandra-journal"
7 | journal.plugin = "jdbc-journal"
8 | }
9 | jdbc-journal {
10 | shared-databases {
11 | slick {
12 | profile = "slick.jdbc.PostgresProfile$"
13 | db {
14 | url = "jdbc:postgresql://localhost:5432/fusion_scheduler?reWriteBatchedInserts=true"
15 | user = "devuser"
16 | password = "devPass.2019"
17 | driver = "org.postgresql.Driver"
18 | }
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/foundation/src/test/scala/me/yangbajing/jdbc/JDBCSpec.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing.jdbc
2 |
3 | import org.postgresql.ds.PGSimpleDataSource
4 | import org.scalatest.BeforeAndAfterAll
5 | import org.scalatest.Suite
6 |
7 | /**
8 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-19.
9 | */
10 | trait JDBCSpec extends BeforeAndAfterAll {
11 | this: Suite =>
12 |
13 | val dataSource = new PGSimpleDataSource
14 |
15 | override protected def beforeAll(): Unit = {
16 | super.beforeAll()
17 | dataSource.setServerName("localhost")
18 | dataSource.setDatabaseName("hldev")
19 | dataSource.setUser("hldev")
20 | dataSource.setPassword("hldev")
21 | }
22 |
23 | override def afterAll(): Unit = {
24 | //dataSource
25 | super.afterAll()
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ant-design-pro/web/appveyor.yml:
--------------------------------------------------------------------------------
1 | # Test against the latest version of this Node.js version
2 | environment:
3 | nodejs_version: "8"
4 |
5 | # this is how to allow failing jobs in the matrix
6 | matrix:
7 | fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
8 |
9 | # Install scripts. (runs after repo cloning)
10 | install:
11 | # Get the latest stable version of Node.js or io.js
12 | - ps: Install-Product node $env:nodejs_version
13 | # install modules
14 | - npm install
15 | # Output useful info for debugging.
16 | - node --version
17 | - npm --version
18 |
19 | # Post-install test scripts.
20 | test_script:
21 | - npm run lint
22 | - npm run test:all
23 | - npm run build
24 |
25 | # Don't actually build.
26 | build: off
27 |
--------------------------------------------------------------------------------
/ant-design-pro/web/docker/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 | # gzip config
4 | gzip on;
5 | gzip_min_length 1k;
6 | gzip_comp_level 9
7 | gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
8 | gzip_vary on;
9 | gzip_disable "MSIE [1-6]\.";
10 |
11 | root /usr/share/nginx/html;
12 |
13 | location / {
14 | try_files $uri $uri/ /index.html;
15 | }
16 | location /api {
17 | proxy_pass https://preview.pro.ant.design;
18 | proxy_set_header X-Forwarded-Proto $scheme;
19 | proxy_set_header Host $http_host;
20 | proxy_set_header X-Real-IP $remote_addr;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/test/src/main/scala/scalaweb/service/OrgService.scala:
--------------------------------------------------------------------------------
1 | package scalaweb.service
2 |
3 | import scalaweb.model.Org
4 | import scalaweb.model.OrgCreateReq
5 | import scalaweb.model.OrgPageReq
6 | import scalaweb.model.OrgPageResp
7 | import scalaweb.respository.OrgRepo
8 | import scalaweb.respository.Schema
9 |
10 | import scala.concurrent.Future
11 |
12 | class OrgService(schema: Schema) {
13 | import schema._
14 |
15 | def page(req: OrgPageReq): Future[OrgPageResp] = run(OrgRepo.page(req))
16 |
17 | def getById(orgId: Int): Future[Option[Org]] = run(OrgRepo.getById(orgId))
18 |
19 | def create(req: OrgCreateReq): Future[Org] = runTransaction(OrgRepo.create(req))
20 |
21 | def removeByIds(ids: Iterable[Int]): Future[Int] =
22 | runTransaction(OrgRepo.removeByIds(ids))
23 | }
24 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/5.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[5],{"0Fdr":function(e,t,a){"use strict";var r=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r(a("MVZn")),n=r(a("o0o1")),u=a("dCQc"),d=a("34ay"),o=a("HZnN"),i={namespace:"register",state:{status:void 0},effects:{submit:n.default.mark(function e(t,a){var r,s,d,o;return n.default.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return r=t.payload,s=a.call,d=a.put,e.next=4,s(u.fakeRegister,r);case 4:return o=e.sent,e.next=7,d({type:"registerHandle",payload:o});case 7:case"end":return e.stop()}},e,this)})},reducers:{registerHandle:function(e,t){var a=t.payload;return(0,d.setAuthority)("user"),(0,o.reloadAuthorized)(),(0,s.default)({},e,{status:a.status})}}};t.default=i}}]);
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/demo/AuthorizedFunction.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 2
3 | title:
4 | zh-CN: 使用方法作为参数
5 | en-US: Use function as a parameter
6 | ---
7 |
8 | Use Function as a parameter
9 |
10 | ```jsx
11 | import RenderAuthorized from 'ant-design-pro/lib/Authorized';
12 | import { Alert } from 'antd';
13 |
14 | const Authorized = RenderAuthorized('user');
15 | const noMatch = ;
16 |
17 | const havePermission = () => {
18 | return false;
19 | };
20 |
21 | ReactDOM.render(
22 |
23 |
28 | ,
29 | mountNode,
30 | );
31 | ```
32 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as numeral from 'numeral';
2 | export { default as ChartCard } from './ChartCard';
3 | export { default as Bar } from './Bar';
4 | export { default as Pie } from './Pie';
5 | export { default as Radar } from './Radar';
6 | export { default as Gauge } from './Gauge';
7 | export { default as MiniArea } from './MiniArea';
8 | export { default as MiniBar } from './MiniBar';
9 | export { default as MiniProgress } from './MiniProgress';
10 | export { default as Field } from './Field';
11 | export { default as WaterWave } from './WaterWave';
12 | export { default as TagCloud } from './TagCloud';
13 | export { default as TimelineChart } from './TimelineChart';
14 |
15 | declare const yuan: (value: number | string) => string;
16 |
17 | export { yuan };
18 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/HeaderSearch/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .headerSearch {
4 | :global(.anticon-search) {
5 | cursor: pointer;
6 | font-size: 16px;
7 | }
8 | .input {
9 | transition: width 0.3s, margin-left 0.3s;
10 | width: 0;
11 | background: transparent;
12 | border-radius: 0;
13 | :global(.ant-select-selection) {
14 | background: transparent;
15 | }
16 | input {
17 | border: 0;
18 | padding-left: 0;
19 | padding-right: 0;
20 | box-shadow: none !important;
21 | }
22 | &,
23 | &:hover,
24 | &:focus {
25 | border-bottom: 1px solid @border-color-base;
26 | }
27 | &.show {
28 | width: 210px;
29 | margin-left: 8px;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/TagSelect/demo/simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title: 基础样例
4 | ---
5 |
6 | 结合 `Tag` 的 `TagSelect` 组件,方便的应用于筛选类目的业务场景中。
7 |
8 | ````jsx
9 | import TagSelect from 'ant-design-pro/lib/TagSelect';
10 |
11 | function handleFormSubmit(checkedValue) {
12 | console.log(checkedValue);
13 | }
14 |
15 | ReactDOM.render(
16 |
17 | 类目一
18 | 类目二
19 | 类目三
20 | 类目四
21 | 类目五
22 | 类目六
23 |
24 | , mountNode);
25 | ````
26 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/naming/data/Reply.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package fusion.discovery.server.naming.data
18 |
19 | trait Reply {}
20 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Authorized/renderAuthorize.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable import/no-mutable-exports */
2 | let CURRENT = 'NULL';
3 | /**
4 | * use authority or getAuthority
5 | * @param {string|()=>String} currentAuthority
6 | */
7 | const renderAuthorize = Authorized => currentAuthority => {
8 | if (currentAuthority) {
9 | if (typeof currentAuthority === 'function') {
10 | CURRENT = currentAuthority();
11 | }
12 | if (
13 | Object.prototype.toString.call(currentAuthority) === '[object String]' ||
14 | Array.isArray(currentAuthority)
15 | ) {
16 | CURRENT = currentAuthority;
17 | }
18 | } else {
19 | CURRENT = 'NULL';
20 | }
21 | return Authorized;
22 | };
23 |
24 | export { CURRENT };
25 | export default Authorized => renderAuthorize(Authorized);
26 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/User/models/register.js:
--------------------------------------------------------------------------------
1 | import { fakeRegister } from '@/services/api';
2 | import { setAuthority } from '@/utils/authority';
3 | import { reloadAuthorized } from '@/utils/Authorized';
4 |
5 | export default {
6 | namespace: 'register',
7 |
8 | state: {
9 | status: undefined,
10 | },
11 |
12 | effects: {
13 | *submit({ payload }, { call, put }) {
14 | const response = yield call(fakeRegister, payload);
15 | yield put({
16 | type: 'registerHandle',
17 | payload: response,
18 | });
19 | },
20 | },
21 |
22 | reducers: {
23 | registerHandle(state, { payload }) {
24 | setAuthority('user');
25 | reloadAuthorized();
26 | return {
27 | ...state,
28 | status: payload.status,
29 | };
30 | },
31 | },
32 | };
33 |
--------------------------------------------------------------------------------
/book/src/main/paradox/routing-dsl/index.md:
--------------------------------------------------------------------------------
1 | # 路由DSL
2 |
3 | Akka HTTP提供了高级的抽象来定义服务端路由:Route,以简洁和可读的方式将服务行为表示为可组合的元素(称为 Directive (指令))。指令被组装成起来形成所谓的路由结构,该路由结构的最顶层可用于创建提供给`Http.handleFlow`处理的流(`Flow[HttpRequest, HttpResponse, NotUsed]`,由`Route.handleFlow`显示调用生成,也可由`RouteResult.route2HandlerFlow`来隐式转换)。
4 |
5 | 之前在 @ref:[\[使用 Akka Http 搭建一个简单的 Web 服务\]](../basic/basic.2.md) 已经见过了一个例子。本章将深入的讲解 Routing DSL,看完本章后你当可在业务代码中灵活的运用 Routing DSL 。
6 |
7 | _**Route** 是Akka HTTP提供的 Routing DSL 的核心概念。使用 DSL 构建的所有路由结构(无论单个还是多个),最终都会将类型`RequestContext`转换为`Future[RouteResult]`。_
8 |
9 | @@toc { depth=2 }
10 |
11 | @@@ index
12 |
13 | - [route](route.md)
14 | - [directive](directive.md)
15 | - [custom-directive](custom-directive.md)
16 | - [rejections](rejections.md)
17 | - [exception](exception.md)
18 | - [file-upload](file-upload.md)
19 |
20 | @@@
21 |
--------------------------------------------------------------------------------
/project/Common.scala:
--------------------------------------------------------------------------------
1 | import sbt.Keys._
2 | import sbt._
3 |
4 | object Common {
5 | val basicSettings = Seq(
6 | organization := "me.yangbajing",
7 | organizationName := "Yangbajing's Garden",
8 | organizationHomepage := Some(url("https://www.yangbajing.me")),
9 | homepage := Some(url("https://www.yangbajing.me/scala-web-development/")),
10 | startYear := Some(2018),
11 | licenses += ("Apache-2.0", new URL(
12 | "https://www.apache.org/licenses/LICENSE-2.0.txt")),
13 | javacOptions ++= Seq("-Xlint:deprecation"),
14 | scalacOptions ++= Seq(
15 | "-encoding",
16 | "utf8",
17 | "-unchecked",
18 | "-feature",
19 | "-deprecation"),
20 | javaOptions ++= Seq("-Dnashorn.args=--language=es6"),
21 | libraryDependencies ++= Seq(Dependencies._scalatest))
22 | }
23 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/akkahttp/foundation/boot/Boot.scala:
--------------------------------------------------------------------------------
1 | package akkahttp.foundation.boot
2 |
3 | import akka.http.scaladsl.Http
4 | import akkahttp.foundation.route.Routes
5 | import akkahttp.server.Server._
6 |
7 | import scala.util.Failure
8 | import scala.util.Success
9 |
10 | /**
11 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-17.
12 | */
13 | object Boot {
14 | def main(args: Array[String]): Unit = {
15 | val bindingFuture =
16 | Http().bindAndHandle(
17 | handler = new Routes().route,
18 | interface = "0.0.0.0",
19 | port = 9999)
20 |
21 | bindingFuture.onComplete {
22 | case Success(binding) =>
23 | println(s"Bind success: $binding")
24 | case Failure(cause) =>
25 | cause.printStackTrace()
26 | System.exit(-1)
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/SettingDrawer/BlockChecbox.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Tooltip, Icon } from 'antd';
3 | import style from './index.less';
4 |
5 | const BlockChecbox = ({ value, onChange, list }) => (
6 |
7 | {list.map(item => (
8 |
9 | onChange(item.key)}>
10 |

11 |
17 |
18 |
19 |
20 |
21 | ))}
22 |
23 | );
24 |
25 | export default BlockChecbox;
26 |
--------------------------------------------------------------------------------
/book/src/main/paradox/oauth/oauth.1.md:
--------------------------------------------------------------------------------
1 | # OAuth 2简介
2 |
3 | OAuth 2 是OAuth协议的延续版本,但不向后兼容OAuth 1.0即完全废止了OAuth 1.0。 OAuth 2关注客户端开发者的简易性。
4 | 要么通过组织在资源拥有者和HTTP服务商之间的被批准的交互动作代表用户,要么允许第三方应用代表用户获得访问的权限。
5 | 同时为Web应用,桌面应用和手机,和起居室设备提供专门的认证流程。2012年10月,OAuth 2协议正式发布为 @extref[RFC 6749](rfc:6749)。
6 |
7 | ## OAuth 2 模式
8 |
9 | Web ServerFlow是把OAuth 1.0的三个步骤缩略为两个步骤,首先这个是适合有server的第三方使用的。
10 |
11 | 1. 客户端通过HTTP请求Authorize
12 | 2. 服务端接收到Authorize请求,返回用户登陆页面
13 | 3. 用户在登陆页面登陆
14 | 4. 登录成功后,服务端将浏览器定位到 `redirect_uri`,并同时传递Authorization Code
15 | 5. 客户端使用HTTPS发送Authorization Code
16 | 6. 服务器端收到 `access_token` 请求,验证Authorization Code——生成 `access_token`,`refresh_token`和`expires_in`(过期时间)——`access_token`和`refresh_token`和过期时间入库
17 | 7. 返回`access_token`和`refresh_token`,`expires_in`(过期时间)
18 | 8. 用户使用HTTPS协议,发送`access_token`及相应参数请求开放平台接口
19 |
20 | OAuth 2除了支持浏览器端认证外,还支持APP、C/S客户端认证。
21 |
22 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/MiniProgress/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .miniProgress {
4 | padding: 5px 0;
5 | position: relative;
6 | width: 100%;
7 | .progressWrap {
8 | background-color: @background-color-base;
9 | position: relative;
10 | }
11 | .progress {
12 | transition: all 0.4s cubic-bezier(0.08, 0.82, 0.17, 1) 0s;
13 | border-radius: 1px 0 0 1px;
14 | background-color: @primary-color;
15 | width: 0;
16 | height: 100%;
17 | }
18 | .target {
19 | position: absolute;
20 | top: 0;
21 | bottom: 0;
22 | span {
23 | border-radius: 100px;
24 | position: absolute;
25 | top: 0;
26 | left: 0;
27 | height: 4px;
28 | width: 2px;
29 | }
30 | span:last-child {
31 | top: auto;
32 | bottom: 0;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/HeaderSearch/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title: 全局搜索
4 | ---
5 |
6 | 通常放置在导航工具条右侧。(点击搜索图标预览效果)
7 |
8 | ````jsx
9 | import HeaderSearch from 'ant-design-pro/lib/HeaderSearch';
10 |
11 | ReactDOM.render(
12 |
22 | {
26 | console.log('input', value); // eslint-disable-line
27 | }}
28 | onPressEnter={(value) => {
29 | console.log('enter', value); // eslint-disable-line
30 | }}
31 | />
32 |
33 | , mountNode);
34 | ````
35 |
--------------------------------------------------------------------------------
/book/src/test/scala/book/custom/directive/CustomDirectiveTest.scala:
--------------------------------------------------------------------------------
1 | package book.custom.directive
2 |
3 | import akka.http.scaladsl.server.Directive
4 | import akka.http.scaladsl.server.Directive1
5 | import akka.http.scaladsl.testkit.ScalatestRouteTest
6 | import org.scalatest.FunSuite
7 | import org.scalatest.Matchers
8 | import akka.http.scaladsl.server.Directives._
9 |
10 | class CustomDirectiveTest extends FunSuite with Matchers with ScalatestRouteTest {
11 | val twoIntParameters: Directive[(Int, Int)] =
12 | parameters(("a".as[Int], "b".as[Int]))
13 |
14 | val myDirective: Directive1[String] =
15 | twoIntParameters.tmap {
16 | case (a, b) => (a + b).toString
17 | }
18 |
19 | test("testCustomDirective") {
20 | Get("/?a=2&b=5") ~> myDirective(x => complete(x)) ~> check {
21 | responseAs[String] shouldBe "7"
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/common/src/test/scala/helloscala/test/AkkaSpec.scala:
--------------------------------------------------------------------------------
1 | package helloscala.test
2 |
3 | import akka.actor.ActorSystem
4 | import akka.stream.Materializer
5 | import org.scalatest.BeforeAndAfterAll
6 | import org.scalatest.Suite
7 |
8 | import scala.concurrent.Await
9 | import scala.concurrent.duration._
10 |
11 | trait AkkaSpec extends BeforeAndAfterAll {
12 | this: Suite =>
13 |
14 | protected def createActorSystem() = ActorSystem("AkkaTest")
15 |
16 | protected def createActorMaterializer()(implicit system: ActorSystem) =
17 | Materializer(system)
18 |
19 | implicit val system: ActorSystem = createActorSystem()
20 |
21 | implicit val materializer: Materializer = createActorMaterializer()
22 |
23 | override protected def afterAll(): Unit = {
24 | super.afterAll()
25 | system.terminate()
26 | Await.result(system.whenTerminated, 30.seconds)
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/33.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-pages-profile-advanced-profile-headerList{margin-bottom:4px}.antd-pro-pages-profile-advanced-profile-tabsCard .ant-card-head{padding:0 16px}.antd-pro-pages-profile-advanced-profile-noData{color:rgba(0,0,0,.25);font-size:16px;line-height:64px;text-align:center}.antd-pro-pages-profile-advanced-profile-noData i{font-size:24px;margin-right:16px;position:relative;top:3px}.antd-pro-pages-profile-advanced-profile-heading{color:rgba(0,0,0,.85);font-size:20px}.antd-pro-pages-profile-advanced-profile-stepDescription{font-size:14px;left:38px;padding-top:8px;position:relative;text-align:left}.antd-pro-pages-profile-advanced-profile-stepDescription>div{margin-bottom:4px;margin-top:8px}.antd-pro-pages-profile-advanced-profile-textSecondary{color:rgba(0,0,0,.45)}@media screen and (max-width:576px){.antd-pro-pages-profile-advanced-profile-stepDescription{left:8px}}
2 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Trend/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Icon } from 'antd';
3 | import classNames from 'classnames';
4 | import styles from './index.less';
5 |
6 | const Trend = ({ colorful = true, reverseColor = false, flag, children, className, ...rest }) => {
7 | const classString = classNames(
8 | styles.trendItem,
9 | {
10 | [styles.trendItemGrey]: !colorful,
11 | [styles.reverseColor]: reverseColor && colorful,
12 | },
13 | className
14 | );
15 | return (
16 |
17 | {children}
18 | {flag && (
19 |
20 |
21 |
22 | )}
23 |
24 | );
25 | };
26 |
27 | export default Trend;
28 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/ArticleListContent/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .listContent {
4 | .description {
5 | line-height: 22px;
6 | max-width: 720px;
7 | }
8 | .extra {
9 | color: @text-color-secondary;
10 | margin-top: 16px;
11 | line-height: 22px;
12 | & > :global(.ant-avatar) {
13 | vertical-align: top;
14 | margin-right: 8px;
15 | width: 20px;
16 | height: 20px;
17 | position: relative;
18 | top: 1px;
19 | }
20 | & > em {
21 | color: @disabled-color;
22 | font-style: normal;
23 | margin-left: 16px;
24 | }
25 | }
26 | }
27 |
28 | @media screen and (max-width: @screen-xs) {
29 | .listContent {
30 | .extra {
31 | & > em {
32 | display: block;
33 | margin-left: 0;
34 | margin-top: 8px;
35 | }
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/PageHeader/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | export interface IPageHeaderProps {
3 | title?: React.ReactNode | string;
4 | logo?: React.ReactNode | string;
5 | action?: React.ReactNode | string;
6 | content?: React.ReactNode;
7 | extraContent?: React.ReactNode;
8 | routes?: any[];
9 | params?: any;
10 | breadcrumbList?: Array<{ title: React.ReactNode; href?: string }>;
11 | tabList?: Array<{ key: string; tab: React.ReactNode }>;
12 | tabActiveKey?: string;
13 | tabDefaultActiveKey?: string;
14 | onTabChange?: (key: string) => void;
15 | tabBarExtraContent?: React.ReactNode;
16 | linkElement?: React.ReactNode;
17 | style?: React.CSSProperties;
18 | home?: React.ReactNode;
19 | wide?: boolean;
20 | hiddenBreadcrumb?:boolean;
21 | }
22 |
23 | export default class PageHeader extends React.Component {}
24 |
--------------------------------------------------------------------------------
/book/src/main/paradox/server-api/advanced.md:
--------------------------------------------------------------------------------
1 | # 高级服务端 API
2 |
3 | 除了低级服务端 API,Akka HTTP 还提供了非常灵活的 **Routing DSL** 来优雅的定义 RESTful 风格的 Web 服务。
4 |
5 | Akka HTTP 高级 API 提供了如下功能特性:
6 |
7 | - 基于高级 API 的 HTTP Server 错误处理
8 | - 服务端 HTTPS 支持
9 | - Routing DSL:将各种元素(Directives 指令)进行组合,以简洁、易读的方式使用 DSL 来表达服务
10 | - Routes:“路由”是 Akka HTTP 提供的 Routing DSL 的核心概念,使用 DSL 构建的所有结构,不管是单条还是很多,都是如下类型的实例:`type Route = RequestContext => Future[RouteResult]`
11 | - Directives:“指令”是用来创建复杂路由结构的小积木。Akka HTTP 已经预定义了大量的 directives,你也可以很方便的建立自己的指令。
12 | - Rejections:在多个路由的构建中,`~` 操作符允许第1条路由被拒绝后继续第2条路由,直到被处理为止。这是,若没有任何路由被匹配,则 "rejections" 可以提供友好的错误处理。
13 | - Exception 处理:当路由中有异常被抛出时,使用 `ExceptionHandler` 可以优雅的进行错误处理或恢复。
14 | - Case Class 提取:可以将请求参数提取成一个 `case class`,如:`parameters('red.as[Int], 'green.as[Int], 'blue.as[Int]).as(Color) { color =>`
15 | - Source Streaming:与 Akka Stream 的结合
16 | - Route TestKit:方便对路由和各 Akka HTTP 功能进行测试
17 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/GlobalFooter/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title: 演示
4 | iframe: 400
5 | ---
6 |
7 | 基本页脚。
8 |
9 | ````jsx
10 | import GlobalFooter from 'ant-design-pro/lib/GlobalFooter';
11 | import { Icon } from 'antd';
12 |
13 | const links = [{
14 | key: '帮助',
15 | title: '帮助',
16 | href: '',
17 | }, {
18 | key: 'github',
19 | title: ,
20 | href: 'https://github.com/ant-design/ant-design-pro',
21 | blankTarget: true,
22 | }, {
23 | key: '条款',
24 | title: '条款',
25 | href: '',
26 | blankTarget: true,
27 | }];
28 |
29 | const copyright = Copyright 2017 蚂蚁金服体验技术部出品
;
30 |
31 | ReactDOM.render(
32 |
36 | , mountNode);
37 | ````
38 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/GlobalFooter/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import classNames from 'classnames';
3 | import styles from './index.less';
4 |
5 | const GlobalFooter = ({ className, links, copyright }) => {
6 | const clsString = classNames(styles.globalFooter, className);
7 | return (
8 |
25 | );
26 | };
27 |
28 | export default GlobalFooter;
29 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/13.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-pages-user-register-main{margin:0 auto;width:368px}.antd-pro-pages-user-register-main .ant-form-item{margin-bottom:24px}.antd-pro-pages-user-register-main h3{font-size:16px;margin-bottom:20px}.antd-pro-pages-user-register-main .antd-pro-pages-user-register-getCaptcha{display:block;width:100%}.antd-pro-pages-user-register-main .antd-pro-pages-user-register-submit{width:50%}.antd-pro-pages-user-register-main .antd-pro-pages-user-register-login{float:right;line-height:40px}.antd-pro-pages-user-register-error,.antd-pro-pages-user-register-success,.antd-pro-pages-user-register-warning{transition:color .3s}.antd-pro-pages-user-register-success{color:#52c41a}.antd-pro-pages-user-register-warning{color:#faad14}.antd-pro-pages-user-register-error{color:#f5222d}.antd-pro-pages-user-register-progress-pass>.antd-pro-pages-user-register-progress .ant-progress-bg{background-color:#faad14}
2 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/HeaderSearch/index.en-US.md:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | en-US: HeaderSearch
4 | zh-CN: HeaderSearch
5 | subtitle: Top search box
6 | cols: 1
7 | order: 8
8 | ---
9 |
10 | Usually placed as an entry to the global search, placed on the right side of the navigation toolbar.
11 |
12 | ## API
13 |
14 | 参数 | 说明 | 类型 | 默认值
15 | ----|------|-----|------
16 | placeholder | placeholder text | string | -
17 | dataSource | current list of prompts | string[] | -
18 | onSearch | Callback when selecting an item or pressing Enter | function(value) | -
19 | onChange | Enter a callback for the search text | function(value) | -
20 | onPressEnter | Callback when pressing Enter | function(value) | -
21 | onVisibleChange | Show or hide the callback of the text box | function(value) |-
22 | defaultOpen | The input box is displayed for the first time. | boolean | false
23 | open | The input box is displayed | booelan |false
--------------------------------------------------------------------------------
/book/src/main/paradox/directives/index.md:
--------------------------------------------------------------------------------
1 | # 常用指令
2 |
3 | Akka HTTP已经预定义了大量的指令,应用开发时可以直接使用。若现存的指令不能满足我们的需求,Akka HTTP也提供了自定义指令的方法。
4 |
5 | Akka HTTP的所有预定义指令都可以通过混入`Directives` trait或导入`Directives._`来访问。
6 |
7 | ```scala
8 | class MyRoute extends Directives {
9 | ....
10 | }
11 |
12 | class MyRoute {
13 | import Directives._
14 | ....
15 | }
16 | ```
17 |
18 | `Directives`按功能分成了很多经类,完成的指令分类和说明见官方文档:[https://doc.akka.io/docs/akka-http/current/routing-dsl/directives/by-trait.html](https://doc.akka.io/docs/akka-http/current/routing-dsl/directives/by-trait.html)。这里我们着重介绍下日常开发工作中经常使用到的指令。
19 |
20 | @@toc { depth=3 }
21 |
22 | @@@ index
23 |
24 | * [PathDirectives(路径指令)](path.md)
25 | * [MethodDirectives](method.md)
26 | * [ParameterDirectives,FormFieldDirectives](parameter_form.md)
27 | * [MarshallingDirectives](marshalling.md)
28 | * [FileUploadDirectives](file.md)
29 | * [CookieDirectives](cookie.md)
30 |
31 | @@@
32 |
--------------------------------------------------------------------------------
/docs/lib/prettify/lang-scala.js:
--------------------------------------------------------------------------------
1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/],
2 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]);
3 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/AvatarList/index.en-US.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: AvatarList
3 | order: 1
4 | cols: 1
5 | ---
6 |
7 | A list of user's avatar for project or group member list frequently. If a large or small AvatarList is desired, set the `size` property to either `large` or `small` and `mini` respectively. Omit the `size` property for a AvatarList with the default size.
8 |
9 | ## API
10 |
11 | ### AvatarList
12 |
13 | | Property | Description | Type | Default |
14 | |----------|------------------------------------------|-------------|-------|
15 | | size | size of list | `large`、`small` 、`mini`, `default` | `default` |
16 |
17 | ### AvatarList.Item
18 |
19 | | Property | Description | Type | Default |
20 | |----------|------------------------------------------|-------------|-------|
21 | | tips | title tips for avatar item | ReactNode\/string | - |
22 | | src | the address of the image for an image avatar | string | - |
23 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/utils/authority.js:
--------------------------------------------------------------------------------
1 | // use localStorage to store the authority info, which might be sent from server in actual project.
2 | export function getAuthority(str) {
3 | // return localStorage.getItem('antd-pro-authority') || ['admin', 'user'];
4 | const authorityString =
5 | typeof str === 'undefined' ? localStorage.getItem('antd-pro-authority') : str;
6 | // authorityString could be admin, "admin", ["admin"]
7 | let authority;
8 | try {
9 | authority = JSON.parse(authorityString);
10 | } catch (e) {
11 | authority = authorityString;
12 | }
13 | if (typeof authority === 'string') {
14 | return [authority];
15 | }
16 | return authority || ['admin'];
17 | }
18 |
19 | export function setAuthority(authority) {
20 | const proAuthority = typeof authority === 'string' ? [authority] : authority;
21 | return localStorage.setItem('antd-pro-authority', JSON.stringify(proAuthority));
22 | }
23 |
--------------------------------------------------------------------------------
/docs/assets/fonts/material-icons.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
3 | * use this file except in compliance with the License. You may obtain a copy
4 | * of the License at:
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
9 | * DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 | * SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
12 | * LIMITATIONS UNDER THE LICENSE.
13 | */@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")}
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/AvatarList/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .avatarList {
4 | display: inline-block;
5 | ul {
6 | display: inline-block;
7 | margin-left: 8px;
8 | font-size: 0;
9 | }
10 | }
11 |
12 | .avatarItem {
13 | display: inline-block;
14 | font-size: @font-size-base;
15 | margin-left: -8px;
16 | width: @avatar-size-base;
17 | height: @avatar-size-base;
18 | :global {
19 | .ant-avatar {
20 | border: 1px solid #fff;
21 | }
22 | }
23 | }
24 |
25 | .avatarItemLarge {
26 | width: @avatar-size-lg;
27 | height: @avatar-size-lg;
28 | }
29 |
30 | .avatarItemSmall {
31 | width: @avatar-size-sm;
32 | height: @avatar-size-sm;
33 | }
34 |
35 | .avatarItemMini {
36 | width: 20px;
37 | height: 20px;
38 | :global {
39 | .ant-avatar {
40 | width: 20px;
41 | height: 20px;
42 | line-height: 20px;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Ellipsis/demo/number.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 按照字符数省略
5 | en-US: Truncate according to the number of character
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 通过设置 `length` 属性指定文本最长长度,如果超过这个长度会自动截取。
11 |
12 | ## en-US
13 |
14 | `length` attribute specifies the maximum length where the text will automatically be truncated when exceeded.
15 |
16 | ````jsx
17 | import Ellipsis from 'ant-design-pro/lib/Ellipsis';
18 |
19 | const article = 'There were injuries alleged in three cases in 2015, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.';
20 |
21 | ReactDOM.render(
22 |
23 | {article}
24 |
Show Tooltip
25 | {article}
26 |
27 | , mountNode);
28 | ````
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Profile/models/profile.js:
--------------------------------------------------------------------------------
1 | import { queryBasicProfile, queryAdvancedProfile } from '@/services/api';
2 |
3 | export default {
4 | namespace: 'profile',
5 |
6 | state: {
7 | basicGoods: [],
8 | advancedOperation1: [],
9 | advancedOperation2: [],
10 | advancedOperation3: [],
11 | },
12 |
13 | effects: {
14 | *fetchBasic(_, { call, put }) {
15 | const response = yield call(queryBasicProfile);
16 | yield put({
17 | type: 'show',
18 | payload: response,
19 | });
20 | },
21 | *fetchAdvanced(_, { call, put }) {
22 | const response = yield call(queryAdvancedProfile);
23 | yield put({
24 | type: 'show',
25 | payload: response,
26 | });
27 | },
28 | },
29 |
30 | reducers: {
31 | show(state, { payload }) {
32 | return {
33 | ...state,
34 | ...payload,
35 | };
36 | },
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Account/Settings/PhoneView.js:
--------------------------------------------------------------------------------
1 | import React, { Fragment, PureComponent } from 'react';
2 | import { Input } from 'antd';
3 | import styles from './PhoneView.less';
4 |
5 | class PhoneView extends PureComponent {
6 | render() {
7 | const { value, onChange } = this.props;
8 | let values = ['', ''];
9 | if (value) {
10 | values = value.split('-');
11 | }
12 | return (
13 |
14 | {
18 | onChange(`${e.target.value}-${values[1]}`);
19 | }}
20 | />
21 | {
24 | onChange(`${values[0]}-${e.target.value}`);
25 | }}
26 | value={values[1]}
27 | />
28 |
29 | );
30 | }
31 | }
32 |
33 | export default PhoneView;
34 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/User/Register.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .main {
4 | width: 368px;
5 | margin: 0 auto;
6 |
7 | :global {
8 | .ant-form-item {
9 | margin-bottom: 24px;
10 | }
11 | }
12 |
13 | h3 {
14 | font-size: 16px;
15 | margin-bottom: 20px;
16 | }
17 |
18 | .getCaptcha {
19 | display: block;
20 | width: 100%;
21 | }
22 |
23 | .submit {
24 | width: 50%;
25 | }
26 |
27 | .login {
28 | float: right;
29 | line-height: @btn-height-lg;
30 | }
31 | }
32 |
33 | .success,
34 | .warning,
35 | .error {
36 | transition: color 0.3s;
37 | }
38 |
39 | .success {
40 | color: @success-color;
41 | }
42 |
43 | .warning {
44 | color: @warning-color;
45 | }
46 |
47 | .error {
48 | color: @error-color;
49 | }
50 |
51 | .progress-pass > .progress {
52 | :global {
53 | .ant-progress-bg {
54 | background-color: @warning-color;
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/ant-design-pro/web/config/plugin.config.js:
--------------------------------------------------------------------------------
1 | // Change theme plugin
2 |
3 | import MergeLessPlugin from 'antd-pro-merge-less';
4 | import AntDesignThemePlugin from 'antd-pro-theme-webpack-plugin';
5 | import path from 'path';
6 |
7 | export default config => {
8 | // 将所有 less 合并为一个供 themePlugin使用
9 | const outFile = path.join(__dirname, '../.temp/ant-design-pro.less');
10 | const stylesDir = path.join(__dirname, '../src/');
11 |
12 | config.plugin('merge-less').use(MergeLessPlugin, [
13 | {
14 | stylesDir,
15 | outFile,
16 | },
17 | ]);
18 |
19 | config.plugin('ant-design-theme').use(AntDesignThemePlugin, [
20 | {
21 | antDir: path.join(__dirname, '../node_modules/antd'),
22 | stylesDir,
23 | varFile: path.join(__dirname, '../node_modules/antd/lib/style/themes/default.less'),
24 | mainLessFile: outFile, // themeVariables: ['@primary-color'],
25 | indexFileName: 'index.html',
26 | },
27 | ]);
28 | };
29 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/MiniProgress/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { Tooltip } from 'antd';
3 |
4 | import styles from './index.less';
5 |
6 | const MiniProgress = ({ target, color = 'rgb(19, 194, 194)', strokeWidth, percent }) => (
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
24 |
25 | );
26 |
27 | export default MiniProgress;
28 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Login/index.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .login {
4 | :global {
5 | .ant-tabs .ant-tabs-bar {
6 | border-bottom: 0;
7 | margin-bottom: 24px;
8 | text-align: center;
9 | }
10 |
11 | .ant-form-item {
12 | margin: 0 2px 24px;
13 | }
14 | }
15 |
16 | .icon {
17 | font-size: 24px;
18 | color: rgba(0, 0, 0, 0.2);
19 | margin-left: 16px;
20 | vertical-align: middle;
21 | cursor: pointer;
22 | transition: color 0.3s;
23 |
24 | &:hover {
25 | color: @primary-color;
26 | }
27 | }
28 |
29 | .other {
30 | text-align: left;
31 | margin-top: 24px;
32 | line-height: 22px;
33 |
34 | .register {
35 | float: right;
36 | }
37 | }
38 |
39 | .prefixIcon {
40 | font-size: @font-size-base;
41 | color: @disabled-color;
42 | }
43 |
44 | .submit {
45 | width: 100%;
46 | margin-top: 24px;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/TagSelect/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title:
3 | en-US: TagSelect
4 | zh-CN: TagSelect
5 | subtitle: 标签选择器
6 | cols: 1
7 | order: 13
8 | ---
9 |
10 | 可进行多选,带折叠收起和展开更多功能,常用于对列表进行筛选。
11 |
12 | ## API
13 |
14 | ### TagSelect
15 |
16 | | 参数 | 说明 | 类型 | 默认值 |
17 | |----------|------------------------------------------|-------------|-------|
18 | | value |选中的项 |string[] \| number[] | |
19 | | defaultValue |默认选中的项 |string[] \| number[] | |
20 | | onChange | 标签选择的回调函数 | Function(checkedTags) | |
21 | | expandable | 是否展示 `展开/收起` 按钮 | Boolean | false |
22 | | hideCheckAll | 隐藏 `全部` 按钮 | Boolean | false |
23 |
24 | ### TagSelectOption
25 |
26 | | 参数 | 说明 | 类型 | 默认值 |
27 | |----------|------------------------------------------|-------------|-------|
28 | | value | TagSelect的值 | string\| number | - |
29 | | children | tag的内容 | string \| ReactNode | - |
30 |
--------------------------------------------------------------------------------
/config-discovery/src/test/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/config-discovery/src/multi-jvm/resources/logback-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.scalafmt.conf:
--------------------------------------------------------------------------------
1 | version = 2.2.2
2 | style = defaultWithAlign
3 | lineEndings = unix
4 | encoding = "UTF-8"
5 | project.git = true
6 | docstrings = JavaDoc
7 | maxColumn = 84
8 | indentOperator = spray
9 | unindentTopLevelOperators = true
10 | align.tokens = [{code = "=>", owner = "Case"}]
11 | align.openParenDefnSite = false
12 | align.openParenCallSite = false
13 | optIn.breakChainOnFirstMethodDot = false
14 | optIn.configStyleArguments = false
15 | danglingParentheses = false
16 | spaces.inImportCurlyBraces = true
17 | rewrite.neverInfix.excludeFilters = [
18 | and
19 | min
20 | max
21 | until
22 | to
23 | by
24 | eq
25 | ne
26 | "should.*"
27 | "contain.*"
28 | "must.*"
29 | in
30 | ignore
31 | be
32 | taggedAs
33 | thrownBy
34 | synchronized
35 | have
36 | when
37 | size
38 | only
39 | noneOf
40 | oneElementOf
41 | noElementsOf
42 | atLeastOneElementOf
43 | atMostOneElementOf
44 | allElementsOf
45 | inOrderElementsOf
46 | theSameElementsAs
47 | ]
48 |
--------------------------------------------------------------------------------
/foundation/src/test/scala/me/yangbajing/MeSpec.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing
2 |
3 | import akka.actor.ActorSystem
4 | import akka.stream.Materializer
5 | import org.scalatest._
6 | import org.scalatest.concurrent.ScalaFutures
7 | import org.scalatest.time.Milliseconds
8 | import org.scalatest.time.Seconds
9 | import org.scalatest.time.Span
10 |
11 | /**
12 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-19.
13 | */
14 | trait MeSpec
15 | extends WordSpec
16 | with Matchers
17 | with OptionValues
18 | with EitherValues
19 | with ScalaFutures
20 | with BeforeAndAfterAll {
21 | implicit val system = ActorSystem("scalatest")
22 | implicit val mat = Materializer(system)
23 | implicit def ec = system.dispatcher
24 |
25 | implicit override def patienceConfig: PatienceConfig =
26 | PatienceConfig(Span(90, Seconds), Span(50, Milliseconds))
27 |
28 | override protected def afterAll(): Unit = {
29 | system.terminate()
30 | super.afterAll()
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/naming/NamingCommandWrapper.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | //package fusion.discovery.server.naming
18 | //
19 | //import fusion.core.FusionProtocol
20 | //import fusion.json.jackson.CborSerializable
21 | //
22 | ////case class NamingCommandWrapper(command: Namings.Command) extends FusionProtocol.Command with CborSerializable
23 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/config/ConfigCommandWrapper.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | //package fusion.discovery.server.config
18 | //
19 | //import fusion.core.FusionProtocol
20 | //import fusion.json.jackson.CborSerializable
21 | //
22 | //case class ConfigCommandWrapper(command: ConfigManager.Command) extends FusionProtocol.Command with CborSerializable
23 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Charts/demo/pie.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 5
3 | title: 饼状图
4 | ---
5 |
6 | ```jsx
7 | import { Pie, yuan } from 'ant-design-pro/lib/Charts';
8 |
9 | const salesPieData = [
10 | {
11 | x: '家用电器',
12 | y: 4544,
13 | },
14 | {
15 | x: '食用酒水',
16 | y: 3321,
17 | },
18 | {
19 | x: '个护健康',
20 | y: 3113,
21 | },
22 | {
23 | x: '服饰箱包',
24 | y: 2341,
25 | },
26 | {
27 | x: '母婴产品',
28 | y: 1231,
29 | },
30 | {
31 | x: '其他',
32 | y: 1231,
33 | },
34 | ];
35 |
36 | ReactDOM.render(
37 | (
42 | now.y + pre, 0))
45 | }}
46 | />
47 | )}
48 | data={salesPieData}
49 | valueFormat={val => }
50 | height={294}
51 | />,
52 | mountNode,
53 | );
54 | ```
55 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/9.async.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[9],{LY9D:function(e,t,a){"use strict";var n=a("TqRt");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(a("MVZn")),c=n(a("o0o1")),s=a("dCQc"),o={namespace:"profile",state:{basicGoods:[],advancedOperation1:[],advancedOperation2:[],advancedOperation3:[]},effects:{fetchBasic:c.default.mark(function e(t,a){var n,r,o;return c.default.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return n=a.call,r=a.put,e.next=3,n(s.queryBasicProfile);case 3:return o=e.sent,e.next=6,r({type:"show",payload:o});case 6:case"end":return e.stop()}},e,this)}),fetchAdvanced:c.default.mark(function e(t,a){var n,r,o;return c.default.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return n=a.call,r=a.put,e.next=3,n(s.queryAdvancedProfile);case 3:return o=e.sent,e.next=6,r({type:"show",payload:o});case 6:case"end":return e.stop()}},e,this)})},reducers:{show:function(e,t){var a=t.payload;return(0,r.default)({},e,a)}}};t.default=o}}]);
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/Profile/AdvancedProfile.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 |
3 | .headerList {
4 | margin-bottom: 4px;
5 | }
6 |
7 | .tabsCard {
8 | :global {
9 | .ant-card-head {
10 | padding: 0 16px;
11 | }
12 | }
13 | }
14 |
15 | .noData {
16 | color: @disabled-color;
17 | text-align: center;
18 | line-height: 64px;
19 | font-size: 16px;
20 | i {
21 | font-size: 24px;
22 | margin-right: 16px;
23 | position: relative;
24 | top: 3px;
25 | }
26 | }
27 |
28 | .heading {
29 | color: @heading-color;
30 | font-size: 20px;
31 | }
32 |
33 | .stepDescription {
34 | font-size: 14px;
35 | position: relative;
36 | left: 38px;
37 | padding-top: 8px;
38 | text-align: left;
39 |
40 | > div {
41 | margin-top: 8px;
42 | margin-bottom: 4px;
43 | }
44 | }
45 |
46 | .textSecondary {
47 | color: @text-color-secondary;
48 | }
49 |
50 | @media screen and (max-width: @screen-sm) {
51 | .stepDescription {
52 | left: 8px;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/config/ConfigRoute.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package fusion.discovery.server.config
18 |
19 | import akka.actor.typed.ActorSystem
20 | import akka.http.scaladsl.server.Route
21 | import fusion.http.server.AbstractRoute
22 |
23 | class ConfigRoute(system: ActorSystem[_]) extends AbstractRoute {
24 | override def route: Route = ???
25 | }
26 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/config/ConfigSetting.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package fusion.discovery.server.config
18 |
19 | import helloscala.common.Configuration
20 |
21 | final class ConfigSetting(configuration: Configuration) {
22 | private val c = configuration.getConfiguration("fusion.discovery.server.config")
23 | val enable = c.getBoolean("enable")
24 | }
25 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/naming/NamingRoute.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package fusion.discovery.server.naming
18 |
19 | import akka.actor.typed.ActorSystem
20 | import akka.http.scaladsl.server.Route
21 | import fusion.http.server.AbstractRoute
22 |
23 | class NamingRoute(system: ActorSystem[_]) extends AbstractRoute {
24 | override def route: Route = ???
25 | }
26 |
--------------------------------------------------------------------------------
/config-discovery/src/main/scala/fusion/discovery/server/naming/NamingSetting.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 helloscala.com
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package fusion.discovery.server.naming
18 |
19 | import helloscala.common.Configuration
20 |
21 | final class NamingSetting(configuration: Configuration) {
22 | private val c = configuration.getConfiguration("fusion.discovery.server.naming")
23 | val enable = c.getBoolean("enable")
24 | }
25 |
--------------------------------------------------------------------------------
/foundation/src/main/scala/me/yangbajing/jdbc/WrappedResultSet.scala:
--------------------------------------------------------------------------------
1 | package me.yangbajing.jdbc
2 |
3 | import java.sql.ResultSet
4 | import java.time.LocalDateTime
5 |
6 | /**
7 | * Created by yangbajing(yangbajing@gmail.com) on 2017-04-19.
8 | */
9 | class WrappedResultSet(val underlying: ResultSet) {
10 | def getBigDecimal(column: String): BigDecimal = {
11 | val value = underlying.getBigDecimal(column)
12 | if (value == null) null else BigDecimal(value)
13 | }
14 |
15 | def getBigDecimal(column: Int): BigDecimal = {
16 | val value = underlying.getBigDecimal(column)
17 | if (value == null) null else BigDecimal(value)
18 | }
19 |
20 | def getLocalDateTime(column: String): LocalDateTime = {
21 | val value = underlying.getTimestamp(column)
22 | if (value == null) null else value.toLocalDateTime
23 | }
24 |
25 | def getLocalDateTime(column: Int): LocalDateTime = {
26 | val value = underlying.getTimestamp(column)
27 | if (value == null) null else value.toLocalDateTime
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/DescriptionList/DescriptionList.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import classNames from 'classnames';
3 | import { Row } from 'antd';
4 | import styles from './index.less';
5 |
6 | const DescriptionList = ({
7 | className,
8 | title,
9 | col = 3,
10 | layout = 'horizontal',
11 | gutter = 32,
12 | children,
13 | size,
14 | ...restProps
15 | }) => {
16 | const clsString = classNames(styles.descriptionList, styles[layout], className, {
17 | [styles.small]: size === 'small',
18 | [styles.large]: size === 'large',
19 | });
20 | const column = col > 4 ? 4 : col;
21 | return (
22 |
23 | {title ?
{title}
: null}
24 |
25 | {React.Children.map(
26 | children,
27 | child => (child ? React.cloneElement(child, { column }) : child)
28 | )}
29 |
30 |
31 | );
32 | };
33 |
34 | export default DescriptionList;
35 |
--------------------------------------------------------------------------------
/oauth/web/auth/authorize.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Authorize Login
6 |
7 |
8 |
9 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Result/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import classNames from 'classnames';
3 | import { Icon } from 'antd';
4 | import styles from './index.less';
5 |
6 | export default function Result({
7 | className,
8 | type,
9 | title,
10 | description,
11 | extra,
12 | actions,
13 | ...restProps
14 | }) {
15 | const iconMap = {
16 | error: ,
17 | success: ,
18 | };
19 | const clsString = classNames(styles.result, className);
20 | return (
21 |
22 |
{iconMap[type]}
23 |
{title}
24 | {description &&
{description}
}
25 | {extra &&
{extra}
}
26 | {actions &&
{actions}
}
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/scala/scalaweb/ant/design/pro/Main.scala:
--------------------------------------------------------------------------------
1 | package scalaweb.ant.design.pro
2 |
3 | import akka.actor.ActorSystem
4 | import akka.http.scaladsl.Http
5 | import akka.stream.Materializer
6 | import com.typesafe.scalalogging.StrictLogging
7 | import scalaweb.ant.design.pro.route.Routes
8 |
9 | import scala.util.Failure
10 | import scala.util.Success
11 |
12 | // #main
13 | object Main extends App with StrictLogging {
14 | implicit val system = ActorSystem()
15 | implicit val materializer = Materializer(system)
16 | import system.dispatcher
17 |
18 | val bindingFuture =
19 | Http().bindAndHandle(
20 | handler = new Routes().route,
21 | interface = "0.0.0.0",
22 | port = 22222)
23 |
24 | bindingFuture.onComplete {
25 | case Success(binding) =>
26 | sys.addShutdownHook(system.terminate())
27 | logger.info(s"启动Akka HTTP Server成功,绑定地址: $binding")
28 | case Failure(e) =>
29 | logger.error(s"启动Akka HTTP Server失败:${e.getMessage}", e)
30 | system.terminate()
31 | }
32 | }
33 | // #main
34 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/Login/LoginTab.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Tabs } from 'antd';
3 | import LoginContext from './loginContext';
4 |
5 | const { TabPane } = Tabs;
6 |
7 | const generateId = (() => {
8 | let i = 0;
9 | return (prefix = '') => {
10 | i += 1;
11 | return `${prefix}${i}`;
12 | };
13 | })();
14 |
15 | class LoginTab extends Component {
16 | constructor(props) {
17 | super(props);
18 | this.uniqueId = generateId('login-tab-');
19 | }
20 |
21 | componentDidMount() {
22 | const { tabUtil } = this.props;
23 | tabUtil.addTab(this.uniqueId);
24 | }
25 |
26 | render() {
27 | const { children } = this.props;
28 | return {children};
29 | }
30 | }
31 |
32 | const wrapContext = props => (
33 |
34 | {value => }
35 |
36 | );
37 |
38 | // 标志位 用来判断是不是自定义组件
39 | wrapContext.typeName = 'LoginTab';
40 |
41 | export default wrapContext;
42 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/components/NoticeIcon/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import NoticeIconTab, { INoticeIconData } from './NoticeIconTab';
3 |
4 | export interface INoticeIconProps {
5 | count?: number;
6 | bell?: React.ReactNode;
7 | className?: string;
8 | loading?: boolean;
9 | onClear?: (tabName: string) => void;
10 | onItemClick?: (item: INoticeIconData, tabProps: INoticeIconProps) => void;
11 | onTabChange?: (tabTile: string) => void;
12 | popupAlign?: {
13 | points?: [string, string];
14 | offset?: [number, number];
15 | targetOffset?: [number, number];
16 | overflow?: any;
17 | useCssRight?: boolean;
18 | useCssBottom?: boolean;
19 | useCssTransform?: boolean;
20 | };
21 | style?: React.CSSProperties;
22 | onPopupVisibleChange?: (visible: boolean) => void;
23 | popupVisible?: boolean;
24 | locale?: { emptyText: string; clear: string };
25 | }
26 |
27 | export default class NoticeIcon extends React.Component {
28 | public static Tab: typeof NoticeIconTab;
29 | }
30 |
--------------------------------------------------------------------------------
/ant-design-pro/src/main/resources/dist/17.chunk.css:
--------------------------------------------------------------------------------
1 | .antd-pro-components-active-chart-index-activeChart{position:relative}.antd-pro-components-active-chart-index-activeChartGrid p{position:absolute;top:80px}.antd-pro-components-active-chart-index-activeChartGrid p:last-child{top:115px}.antd-pro-components-active-chart-index-activeChartLegend{font-size:0;height:20px;line-height:20px;margin-top:8px;position:relative}.antd-pro-components-active-chart-index-activeChartLegend span{display:inline-block;font-size:12px;text-align:center;width:33.33%}.antd-pro-components-active-chart-index-activeChartLegend span:first-child{text-align:left}.antd-pro-components-active-chart-index-activeChartLegend span:last-child{text-align:right}
2 | .antd-pro-pages-dashboard-monitor-mapChart{height:457px;padding-top:24px;text-align:center}.antd-pro-pages-dashboard-monitor-mapChart img{display:inline-block;max-height:437px;max-width:100%}.antd-pro-pages-dashboard-monitor-pieCard .pie-stat{font-size:24px!important}@media screen and (max-width:992px){.antd-pro-pages-dashboard-monitor-mapChart{height:auto}}
3 |
--------------------------------------------------------------------------------
/ant-design-pro/web/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | parser: 'babel-eslint',
3 | extends: ['airbnb', 'prettier', 'plugin:compat/recommended'],
4 | env: {
5 | browser: true,
6 | node: true,
7 | es6: true,
8 | mocha: true,
9 | jest: true,
10 | jasmine: true,
11 | },
12 | globals: {
13 | APP_TYPE: true,
14 | },
15 | rules: {
16 | 'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
17 | 'react/jsx-wrap-multilines': 0,
18 | 'react/prop-types': 0,
19 | 'react/forbid-prop-types': 0,
20 | 'react/jsx-one-expression-per-line': 0,
21 | 'import/no-unresolved': [2, { ignore: ['^@/', '^umi/'] }],
22 | 'import/no-extraneous-dependencies': [2, { optionalDependencies: true }],
23 | 'jsx-a11y/no-noninteractive-element-interactions': 0,
24 | 'jsx-a11y/click-events-have-key-events': 0,
25 | 'jsx-a11y/no-static-element-interactions': 0,
26 | 'jsx-a11y/anchor-is-valid': 0,
27 | 'linebreak-style': 0,
28 | },
29 | settings: {
30 | polyfills: ['fetch', 'promises', 'url'],
31 | },
32 | };
33 |
--------------------------------------------------------------------------------
/ant-design-pro/web/src/pages/List/Applications.less:
--------------------------------------------------------------------------------
1 | @import '~antd/lib/style/themes/default.less';
2 | @import '~@/utils/utils.less';
3 |
4 | .filterCardList {
5 | margin-bottom: -24px;
6 | :global {
7 | .ant-card-meta-content {
8 | margin-top: 0;
9 | }
10 | // disabled white space
11 | .ant-card-meta-avatar {
12 | font-size: 0;
13 | }
14 | .ant-card-actions {
15 | background: #f7f9fa;
16 | }
17 | .ant-list .ant-list-item-content-single {
18 | max-width: 100%;
19 | }
20 | }
21 | .cardInfo {
22 | .clearfix();
23 | margin-top: 16px;
24 | margin-left: 40px;
25 | & > div {
26 | position: relative;
27 | text-align: left;
28 | float: left;
29 | width: 50%;
30 | p {
31 | line-height: 32px;
32 | font-size: 24px;
33 | margin: 0;
34 | }
35 | p:first-child {
36 | color: @text-color-secondary;
37 | font-size: 12px;
38 | line-height: 20px;
39 | margin-bottom: 4px;
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------