diff --git a/admin-web/mock/admin.js b/admin-web/mock/admin.js index 60c11d9c5..4a9df2b0e 100644 --- a/admin-web/mock/admin.js +++ b/admin-web/mock/admin.js @@ -1,4 +1,6 @@ /* eslint-disable */ +import mockjs from 'mockjs'; +import { resultBody } from './mock-comment'; import adminMenu from './geographic/admin-menu.json'; import adminMenuAll from './geographic/admin-menu-all.json'; import adminUrls from './geographic/admin-urls'; @@ -25,9 +27,28 @@ function getQueryRole(req, res) { return res.json(roleQuery); } +function getDictionaryKeys(req, res) { + const values = mockjs.mock({ + 'list|5': [{ 'value|+1': 0, text: '@city' }], + }); + + return res.json(resultBody(values)); +} + +function getDictionaryText(req, res) { + const values = mockjs.mock({ + text: '@city', + }); + + return res.json(resultBody(values)); +} + export default { 'GET /admin-api/admins/resource/admin_menu_tree': getAdminMenuAll, 'GET /admin-api/admins/resource/admin_url_list': getAdminUrls, 'GET /admin-api/admins/resource/tree': getResourceTree, 'GET /admin-api/admins/role/page': getQueryRole, + 'GET /admin-api/admins/admin/page': getQueryRole, + 'GET /admin-api/admins/dictionary/getList': getDictionaryKeys, + 'GET /admin-api/admins/dictionary/queryText': getDictionaryText, }; diff --git a/admin-web/mock/mock-comment.js b/admin-web/mock/mock-comment.js new file mode 100644 index 000000000..c7131bcb4 --- /dev/null +++ b/admin-web/mock/mock-comment.js @@ -0,0 +1,13 @@ +// 常用,公共 mock + +export function resultBody(result, code, message) { + return { + code: code || 0, + message: message || '', + ...(result || null), + }; +} + +export default { + resultBody, +}; diff --git a/admin-web/src/components/Dictionary/DictionarySelect.d.ts b/admin-web/src/components/Dictionary/DictionarySelect.d.ts new file mode 100644 index 000000000..40dbda604 --- /dev/null +++ b/admin-web/src/components/Dictionary/DictionarySelect.d.ts @@ -0,0 +1,13 @@ +import * as React from 'react'; +import { Select } from 'antd'; + +export interface DictionaryObject { + text?: string; + value?: string | number | boolean; +} + +export interface IDictionarySelectProps extends Select { + list?: DictionaryObject[]; +} + +export default class DictionarySelectD extends React.Component {} diff --git a/admin-web/src/components/Dictionary/DictionarySelect.js b/admin-web/src/components/Dictionary/DictionarySelect.js new file mode 100644 index 000000000..29211d229 --- /dev/null +++ b/admin-web/src/components/Dictionary/DictionarySelect.js @@ -0,0 +1,20 @@ +import React, { PureComponent } from 'react'; +import { Select } from 'antd'; + +export default class DictionarySelect extends PureComponent { + renderOptions() { + const { list } = this.props; + return list.map(item => { + return ( + + {item.text} + + ); + }); + } + + render() { + const options = this.renderOptions(); + return ; + } +} diff --git a/admin-web/src/components/Dictionary/DictionarySelect.md b/admin-web/src/components/Dictionary/DictionarySelect.md new file mode 100644 index 000000000..447bab237 --- /dev/null +++ b/admin-web/src/components/Dictionary/DictionarySelect.md @@ -0,0 +1,24 @@ +--- +title: DictionarySelect +subtitle: 描述列表 +--- + +次组件跟使用 Antd extends Select,使用方法跟 Select 一样 + +## API + +### DescriptionList + +| 参数 | 说明 | 类型 | 默认值 | +|----------|------------------------------------------|-------------|-------| +| list | 数据列表 | DictionObject[] | [] | + +### DictionObject + +| 参数 | 说明 | 类型 | 默认值 | +|----------|------------------------------------------|-------------|-------| +| text | 显示的文字 | string | - | +| value | 选择后的值 | string number boolean | - | + + + diff --git a/admin-web/src/models/dictionary/dictionarySelect.js b/admin-web/src/models/dictionary/dictionarySelect.js new file mode 100644 index 000000000..6843328d3 --- /dev/null +++ b/admin-web/src/models/dictionary/dictionarySelect.js @@ -0,0 +1,40 @@ +import { queryKey, queryText } from '../../services/dictionary'; + +export default { + namespace: 'dictionarySelect', + + state: { + list: [], + text: '', + }, + + effects: { + *query({ payload }, { call, put }) { + const response = yield call(queryKey, payload); + yield put({ + type: 'querySuccess', + payload: { + list: response.list, + }, + }); + }, + *queryText({ payload }, { call, put }) { + const response = yield call(queryText, payload); + yield put({ + type: 'querySuccess', + payload: { + text: response.text, + }, + }); + }, + }, + + reducers: { + querySuccess(state, { payload }) { + return { + ...state, + ...payload, + }; + }, + }, +}; diff --git a/admin-web/src/pages/Admin/RoleList.js b/admin-web/src/pages/Admin/RoleList.js index d1435d01f..a746f2249 100644 --- a/admin-web/src/pages/Admin/RoleList.js +++ b/admin-web/src/pages/Admin/RoleList.js @@ -87,6 +87,7 @@ class RoleList extends PureComponent { }; handleAdd = ({ fields, modalType, initValues }) => { + console.log('add ->>>', fields); const { dispatch, data } = this.props; const queryParams = { pageNo: data.pageNo, diff --git a/admin-web/src/pages/Dictionary/DictionaryValueSelect.js b/admin-web/src/pages/Dictionary/DictionaryValueSelect.js new file mode 100644 index 000000000..214d78731 --- /dev/null +++ b/admin-web/src/pages/Dictionary/DictionaryValueSelect.js @@ -0,0 +1,26 @@ +import React, { PureComponent } from 'react'; +import { connect } from 'dva'; +import DictionarySelect from '../../components/Dictionary/DictionarySelect'; + +@connect(({ dictionarySelect, loading }) => ({ + data: dictionarySelect, + loading: loading.models.dictionarySelect, +})) +class DictionaryValueSelect extends PureComponent { + componentDidMount() { + const { dataKey, dispatch } = this.props; + dispatch({ + type: 'dictionarySelect/query', + payload: { + dataKey, + }, + }); + } + + render() { + const { data } = this.props; + return ; + } +} + +export default DictionaryValueSelect; diff --git a/admin-web/src/pages/Dictionary/DictionaryValueText.js b/admin-web/src/pages/Dictionary/DictionaryValueText.js new file mode 100644 index 000000000..901a234ea --- /dev/null +++ b/admin-web/src/pages/Dictionary/DictionaryValueText.js @@ -0,0 +1,26 @@ +import React, { PureComponent } from 'react'; +import { connect } from 'dva'; + +@connect(({ dictionarySelect, loading }) => ({ + data: dictionarySelect, + loading: loading.models.dictionarySelect, +})) +class DictionaryValueText extends PureComponent { + componentDidMount() { + const { dataKey, dispatch } = this.props; + dispatch({ + type: 'dictionarySelect/queryText', + payload: { + dataKey, + value: 1, + }, + }); + } + + render() { + const { data } = this.props; + return {data.text}; + } +} + +export default DictionaryValueText; diff --git a/admin-web/src/pages/Home/Home.js b/admin-web/src/pages/Home/Home.js index 7e1096aa2..949a63ab3 100644 --- a/admin-web/src/pages/Home/Home.js +++ b/admin-web/src/pages/Home/Home.js @@ -2,6 +2,8 @@ import React, { Component } from 'react'; import { Button } from 'antd'; import AuthorityControl from '../../components/AuthorityControl'; import UrlsContext from '../../layouts/UrlsContext'; +import DictionaryValueSelect from '../Dictionary/DictionaryValueSelect'; +import DictionaryValueText from '../Dictionary/DictionaryValueText'; export default class Home extends Component { state = {}; @@ -22,6 +24,9 @@ export default class Home extends Component {

home...

+ + + ); } diff --git a/admin-web/src/services/dictionary.js b/admin-web/src/services/dictionary.js new file mode 100644 index 000000000..51c2c0d00 --- /dev/null +++ b/admin-web/src/services/dictionary.js @@ -0,0 +1,14 @@ +import { stringify } from '@/utils/request.qs'; +import request from '@/utils/request'; + +export async function queryKey(params) { + return request(`/admin-api/admins/dictionary/getList?${stringify(params)}`, { + method: 'GET', + }); +} + +export async function queryText(params) { + return request(`/admin-api/admins/dictionary/queryText?${stringify(params)}`, { + method: 'GET', + }); +} diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class b/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class new file mode 100644 index 000000000..6ddcea436 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/config/GlobalExceptionHandler.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/constant/SysErrorCodeEnum.class b/common/common-framework/target/classes/cn/iocoder/common/framework/constant/SysErrorCodeEnum.class new file mode 100644 index 000000000..919e684f9 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/constant/SysErrorCodeEnum.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/dataobject/BaseDO.class b/common/common-framework/target/classes/cn/iocoder/common/framework/dataobject/BaseDO.class new file mode 100644 index 000000000..b8d9be7b4 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/dataobject/BaseDO.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/exception/ServiceException.class b/common/common-framework/target/classes/cn/iocoder/common/framework/exception/ServiceException.class new file mode 100644 index 000000000..ff0b54cc4 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/exception/ServiceException.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/CollectionUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/CollectionUtil.class new file mode 100644 index 000000000..d6caf6bab Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/CollectionUtil.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class new file mode 100644 index 000000000..1e4f270e0 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ExceptionUtil.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class new file mode 100644 index 000000000..28657f652 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/HttpUtil.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class new file mode 100644 index 000000000..47cd5ff1d Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/util/ServiceExceptionUtil.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/vo/CommonResult.class b/common/common-framework/target/classes/cn/iocoder/common/framework/vo/CommonResult.class new file mode 100644 index 000000000..c379f5db0 Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/vo/CommonResult.class differ diff --git a/common/common-framework/target/classes/cn/iocoder/common/framework/vo/RestResult.class b/common/common-framework/target/classes/cn/iocoder/common/framework/vo/RestResult.class new file mode 100644 index 000000000..59aef019e Binary files /dev/null and b/common/common-framework/target/classes/cn/iocoder/common/framework/vo/RestResult.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/MobileCodeService.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/MobileCodeService.class new file mode 100644 index 000000000..3102c314b Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/MobileCodeService.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/OAuth2Service.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/OAuth2Service.class new file mode 100644 index 000000000..13b731330 Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/OAuth2Service.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/UserService.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/UserService.class new file mode 100644 index 000000000..f97f928c4 Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/UserService.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/OAuth2AccessTokenBO.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/OAuth2AccessTokenBO.class new file mode 100644 index 000000000..1a7dc9724 Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/OAuth2AccessTokenBO.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/OAuth2AuthenticationBO.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/OAuth2AuthenticationBO.class new file mode 100644 index 000000000..d8c2be88c Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/OAuth2AuthenticationBO.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/UserBO.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/UserBO.class new file mode 100644 index 000000000..123b76e5a Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/bo/UserBO.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/constant/ThirdPlatformConstant.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/constant/ThirdPlatformConstant.class new file mode 100644 index 000000000..1239ca28f Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/constant/ThirdPlatformConstant.class differ diff --git a/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/constant/UserErrorCodeEnum.class b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/constant/UserErrorCodeEnum.class new file mode 100644 index 000000000..e3799f640 Binary files /dev/null and b/user/user-service-api/target/classes/cn/iocoder/mall/user/service/api/constant/UserErrorCodeEnum.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/a.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/a.class new file mode 100644 index 000000000..d7e0c50e0 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/a.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/config/DatabaseConfiguration.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/config/DatabaseConfiguration.class new file mode 100644 index 000000000..5bece263d Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/config/DatabaseConfiguration.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/config/ServiceExceptionConfiguration.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/config/ServiceExceptionConfiguration.class new file mode 100644 index 000000000..57c195e48 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/config/ServiceExceptionConfiguration.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/OAuth2Convert.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/OAuth2Convert.class new file mode 100644 index 000000000..901b6c0c9 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/OAuth2Convert.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/OAuth2ConvertImpl.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/OAuth2ConvertImpl.class new file mode 100644 index 000000000..36184ba00 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/OAuth2ConvertImpl.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/UserConvert.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/UserConvert.class new file mode 100644 index 000000000..0e8c9aaab Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/UserConvert.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/UserConvertImpl.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/UserConvertImpl.class new file mode 100644 index 000000000..1a3e01dbf Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/convert/UserConvertImpl.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/MobileCodeMapper.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/MobileCodeMapper.class new file mode 100644 index 000000000..5e5dc2fa7 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/MobileCodeMapper.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/OAuth2AccessTokenMapper.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/OAuth2AccessTokenMapper.class new file mode 100644 index 000000000..cf6130ff8 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/OAuth2AccessTokenMapper.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/OAuth2RefreshTokenMapper.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/OAuth2RefreshTokenMapper.class new file mode 100644 index 000000000..3d4221ddd Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/OAuth2RefreshTokenMapper.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/UserMapper.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/UserMapper.class new file mode 100644 index 000000000..c40498cd1 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/UserMapper.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/UserRegisterMapper.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/UserRegisterMapper.class new file mode 100644 index 000000000..200f969a7 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dao/UserRegisterMapper.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/MobileCodeDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/MobileCodeDO.class new file mode 100644 index 000000000..f822d9283 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/MobileCodeDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/OAuth2AccessTokenDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/OAuth2AccessTokenDO.class new file mode 100644 index 000000000..4f06c9cb9 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/OAuth2AccessTokenDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/OAuth2RefreshTokenDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/OAuth2RefreshTokenDO.class new file mode 100644 index 000000000..3341a5b8c Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/OAuth2RefreshTokenDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserDO.class new file mode 100644 index 000000000..a8d20ca36 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserLoginLogDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserLoginLogDO.class new file mode 100644 index 000000000..03eceb814 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserLoginLogDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserRegisterDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserRegisterDO.class new file mode 100644 index 000000000..9acb260fe Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserRegisterDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserThirdAuthDO.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserThirdAuthDO.class new file mode 100644 index 000000000..abbcec253 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/dataobject/UserThirdAuthDO.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/MobileCodeServiceImpl.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/MobileCodeServiceImpl.class new file mode 100644 index 000000000..831b2cecf Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/MobileCodeServiceImpl.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/OAuth2ServiceImpl.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/OAuth2ServiceImpl.class new file mode 100644 index 000000000..7e78c0388 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/OAuth2ServiceImpl.class differ diff --git a/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/UserServiceImpl.class b/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/UserServiceImpl.class new file mode 100644 index 000000000..25c035930 Binary files /dev/null and b/user/user-service-impl/target/classes/cn/iocoder/mall/user/service/UserServiceImpl.class differ diff --git a/user/user-service-impl/target/classes/config/application.properties b/user/user-service-impl/target/classes/config/application.properties new file mode 100644 index 000000000..529623d82 --- /dev/null +++ b/user/user-service-impl/target/classes/config/application.properties @@ -0,0 +1,8 @@ +##################### 业务模块 ##################### +## MobileCodeService +modules.mobile-code-service.code-expire-time-millis = 600000 +modules.mobile-code-service.send-maximum-quantity-per-day = 10 +modules.mobile-code-service.send-frequency = 60000 +## OAuth2CodeService +modules.oauth2-code-service.access-token-expire-time-millis = 2880000 +modules.oauth2-code-service.refresh-token-expire-time-millis = 43200000 \ No newline at end of file diff --git a/user/user-service-impl/target/classes/config/application.yaml b/user/user-service-impl/target/classes/config/application.yaml new file mode 100644 index 000000000..86d0d17cc --- /dev/null +++ b/user/user-service-impl/target/classes/config/application.yaml @@ -0,0 +1,32 @@ +spring: + # datasource + datasource: + url: jdbc:mysql://127.0.0.1:33061/mall_user?useSSL=false + driver-class-name: com.mysql.jdbc.Driver + username: root + password: 123456 + +# server +server: + port: 8082 + +# mybatis +mybatis: + config-location: classpath:mybatis-config.xml + mapper-locations: classpath:mapper/*.xml + type-aliases-package: cn.iocoder.mall.user.dataobject + +# dubbo +dubbo: + application: + name: user-service + registry: + address: zookeeper://127.0.0.1:2181 + protocol: + port: -1 + name: dubbo + scan: + base-packages: cn.iocoder.mall.user.service +demo: + service: + version: 1.0.0 \ No newline at end of file diff --git a/user/user-service-impl/target/classes/mapper/MobileCodeMapper.xml b/user/user-service-impl/target/classes/mapper/MobileCodeMapper.xml new file mode 100644 index 000000000..f2676639e --- /dev/null +++ b/user/user-service-impl/target/classes/mapper/MobileCodeMapper.xml @@ -0,0 +1,35 @@ + + + + + + INSERT INTO mobile_code ( + id, mobile, code, today_index, used, + used_uid, used_time, create_time + ) VALUES ( + #{id}, #{mobile}, #{code}, #{todayIndex}, #{used}, + #{usedUid}, #{usedTime}, #{createTime} + ) + + + + UPDATE mobile_code + + used = #{used}, + used_uid = #{usedUid}, + used_time = #{usedTime}, + + WHERE id = #{id} + + + + + \ No newline at end of file diff --git a/user/user-service-impl/target/classes/mapper/OAuth2AccessTokenMapper.xml b/user/user-service-impl/target/classes/mapper/OAuth2AccessTokenMapper.xml new file mode 100644 index 000000000..ee3b4dcaa --- /dev/null +++ b/user/user-service-impl/target/classes/mapper/OAuth2AccessTokenMapper.xml @@ -0,0 +1,22 @@ + + + + + + INSERT INTO oauth2_access_token ( + id, refresh_token, adminId, valid, expires_time, + create_time + ) VALUES ( + #{id}, #{refreshToken}, #{adminId}, #{valid}, #{expiresTime}, + #{createTime} + ) + + + + + \ No newline at end of file diff --git a/user/user-service-impl/target/classes/mapper/OAuth2RefreshTokenMapper.xml b/user/user-service-impl/target/classes/mapper/OAuth2RefreshTokenMapper.xml new file mode 100644 index 000000000..b4646aee4 --- /dev/null +++ b/user/user-service-impl/target/classes/mapper/OAuth2RefreshTokenMapper.xml @@ -0,0 +1,13 @@ + + + + + + INSERT INTO oauth2_refresh_token ( + id, adminId, valid, expires_time, create_time + ) VALUES ( + #{id}, #{adminId}, #{valid}, #{expiresTime}, #{createTime} + ) + + + \ No newline at end of file diff --git a/user/user-service-impl/target/classes/mapper/UserMapper.xml b/user/user-service-impl/target/classes/mapper/UserMapper.xml new file mode 100644 index 000000000..48897afae --- /dev/null +++ b/user/user-service-impl/target/classes/mapper/UserMapper.xml @@ -0,0 +1,20 @@ + + + + + + INSERT INTO users ( + id, mobile, create_time + ) VALUES ( + #{id}, #{mobile}, #{createTime} + ) + + + + + \ No newline at end of file diff --git a/user/user-service-impl/target/classes/mapper/UserRegisterMapper.xml b/user/user-service-impl/target/classes/mapper/UserRegisterMapper.xml new file mode 100644 index 000000000..0db1ebabd --- /dev/null +++ b/user/user-service-impl/target/classes/mapper/UserRegisterMapper.xml @@ -0,0 +1,13 @@ + + + + + + INSERT INTO user_register ( + id, create_time + ) VALUES ( + #{id}, #{createTime} + ) + + + \ No newline at end of file diff --git a/user/user-service-impl/target/classes/mybatis-config.xml b/user/user-service-impl/target/classes/mybatis-config.xml new file mode 100644 index 000000000..7f604cc7e --- /dev/null +++ b/user/user-service-impl/target/classes/mybatis-config.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/user/user-service-impl/target/generated-sources/annotations/cn/iocoder/mall/user/convert/OAuth2ConvertImpl.java b/user/user-service-impl/target/generated-sources/annotations/cn/iocoder/mall/user/convert/OAuth2ConvertImpl.java new file mode 100644 index 000000000..6ad80f039 --- /dev/null +++ b/user/user-service-impl/target/generated-sources/annotations/cn/iocoder/mall/user/convert/OAuth2ConvertImpl.java @@ -0,0 +1,41 @@ +package cn.iocoder.mall.user.convert; + +import cn.iocoder.mall.user.dataobject.OAuth2AccessTokenDO; +import cn.iocoder.mall.user.service.api.bo.OAuth2AccessTokenBO; +import cn.iocoder.mall.user.service.api.bo.OAuth2AuthenticationBO; +import javax.annotation.Generated; + +@Generated( + value = "org.mapstruct.ap.MappingProcessor", + date = "2019-03-05T10:35:05+0800", + comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)" +) +public class OAuth2ConvertImpl implements OAuth2Convert { + + @Override + public OAuth2AccessTokenBO convertToAccessToken(OAuth2AccessTokenDO oauth2AccessTokenDO) { + if ( oauth2AccessTokenDO == null ) { + return null; + } + + OAuth2AccessTokenBO oAuth2AccessTokenBO = new OAuth2AccessTokenBO(); + + oAuth2AccessTokenBO.setAccessToken( oauth2AccessTokenDO.getId() ); + oAuth2AccessTokenBO.setRefreshToken( oauth2AccessTokenDO.getRefreshToken() ); + + return oAuth2AccessTokenBO; + } + + @Override + public OAuth2AuthenticationBO convertToAuthentication(OAuth2AccessTokenDO oauth2AccessTokenDO) { + if ( oauth2AccessTokenDO == null ) { + return null; + } + + OAuth2AuthenticationBO oAuth2AuthenticationBO = new OAuth2AuthenticationBO(); + + oAuth2AuthenticationBO.setUid( oauth2AccessTokenDO.getUid() ); + + return oAuth2AuthenticationBO; + } +} diff --git a/user/user-service-impl/target/generated-sources/annotations/cn/iocoder/mall/user/convert/UserConvertImpl.java b/user/user-service-impl/target/generated-sources/annotations/cn/iocoder/mall/user/convert/UserConvertImpl.java new file mode 100644 index 000000000..fb6885ae6 --- /dev/null +++ b/user/user-service-impl/target/generated-sources/annotations/cn/iocoder/mall/user/convert/UserConvertImpl.java @@ -0,0 +1,26 @@ +package cn.iocoder.mall.user.convert; + +import cn.iocoder.mall.user.dataobject.UserDO; +import cn.iocoder.mall.user.service.api.bo.UserBO; +import javax.annotation.Generated; + +@Generated( + value = "org.mapstruct.ap.MappingProcessor", + date = "2019-03-05T10:35:05+0800", + comments = "version: 1.3.0.Final, compiler: javac, environment: Java 1.8.0_181 (Oracle Corporation)" +) +public class UserConvertImpl implements UserConvert { + + @Override + public UserBO convert(UserDO userDO) { + if ( userDO == null ) { + return null; + } + + UserBO userBO = new UserBO(); + + userBO.setMobile( userDO.getMobile() ); + + return userBO; + } +}