Browse Source

更新表

zs 2 years ago
parent
commit
8e7bfbce0d
33 changed files with 1664 additions and 49 deletions
  1. 5 4
      src/config/config.local.ts
  2. 5 4
      src/config/config.prod.ts
  3. 0 18
      src/controller/api.controller.ts
  4. 0 9
      src/controller/home.controller.ts
  5. 89 0
      src/controller/system/dictData.controller.ts
  6. 89 0
      src/controller/system/dictType.controller.ts
  7. 89 0
      src/controller/system/menus.controller.ts
  8. 89 0
      src/controller/system/module.controller.ts
  9. 89 0
      src/controller/system/role.controller.ts
  10. 89 0
      src/controller/user/admin.controller.ts
  11. 89 0
      src/controller/user/personal.controller.ts
  12. 23 0
      src/entity/system/dictData.entity.ts
  13. 20 0
      src/entity/system/dictType.entity.ts
  14. 40 0
      src/entity/system/menus.entity.ts
  15. 21 0
      src/entity/system/module.entity.ts
  16. 25 0
      src/entity/system/role.entity.ts
  17. 35 0
      src/entity/user/admin.entity.ts
  18. 50 0
      src/entity/user/personal.entity.ts
  19. 81 0
      src/interface/system/dictData.interface.ts
  20. 84 0
      src/interface/system/dictType.interface.ts
  21. 139 0
      src/interface/system/menus.interface.ts
  22. 80 0
      src/interface/system/module.interface.ts
  23. 94 0
      src/interface/system/role.interface.ts
  24. 126 0
      src/interface/user/admin.interface.ts
  25. 136 0
      src/interface/user/personal.interface.ts
  26. 11 0
      src/service/system/dictData.service.ts
  27. 11 0
      src/service/system/dictType.service.ts
  28. 11 0
      src/service/system/menus.service.ts
  29. 11 0
      src/service/system/module.service.ts
  30. 11 0
      src/service/system/role.service.ts
  31. 0 14
      src/service/user.service.ts
  32. 11 0
      src/service/user/admin.service.ts
  33. 11 0
      src/service/user/personal.service.ts

+ 5 - 4
src/config/config.local.ts

@@ -1,19 +1,20 @@
 import { MidwayConfig } from '@midwayjs/core';
 const ip = '127.0.0.1';
-const project = 'zkzx_v2';
+const project = 'zkzx';
+const mongodb = 'zkzx_v2';
 export default {
   // use for cookie sign key, should change to your own and keep security
   keys: '1672292154640_555',
   koa: {
-    globalPrefix: `/${project}/v1/api`,
+    globalPrefix: `/${project}/v2/api`,
   },
   swagger: {
-    swaggerPath: `/dev/${project}/v1/api/doc`,
+    swaggerPath: `/dev/${project}/v2/api/doc`,
   },
   mongoose: {
     dataSource: {
       default: {
-        uri: `mongodb://${ip}:27017/${project}`,
+        uri: `mongodb://${ip}:27017/${mongodb}`,
         options: {
           user: 'admin',
           pass: 'admin',

+ 5 - 4
src/config/config.prod.ts

@@ -1,19 +1,20 @@
 import { MidwayConfig } from '@midwayjs/core';
 const ip = '127.0.0.1';
-const project = 'zkzx_v2';
+const project = 'zkzx';
+const mongodb = 'zkzx_v2';
 export default {
   // use for cookie sign key, should change to your own and keep security
   keys: '1672292154640_555',
   koa: {
-    globalPrefix: `/${project}/v1/api`,
+    globalPrefix: `/${project}/v2/api`,
   },
   swagger: {
-    swaggerPath: `/${project}/v1/api/doc`,
+    swaggerPath: `/${project}/v2/api/doc`,
   },
   mongoose: {
     dataSource: {
       default: {
-        uri: `mongodb://${ip}:27017/${project}`,
+        uri: `mongodb://${ip}:27017/${mongodb}`,
         options: {
           user: 'admin',
           pass: 'admin',

+ 0 - 18
src/controller/api.controller.ts

@@ -1,18 +0,0 @@
-import { Inject, Controller, Get, Query } from '@midwayjs/core';
-import { Context } from '@midwayjs/koa';
-import { UserService } from '../service/user.service';
-
-@Controller('/api')
-export class APIController {
-  @Inject()
-  ctx: Context;
-
-  @Inject()
-  userService: UserService;
-
-  @Get('/get_user')
-  async getUser(@Query('uid') uid) {
-    const user = await this.userService.getUser({ uid });
-    return { success: true, message: 'OK', data: user };
-  }
-}

+ 0 - 9
src/controller/home.controller.ts

@@ -1,9 +0,0 @@
-import { Controller, Get } from '@midwayjs/core';
-
-@Controller('/')
-export class HomeController {
-  @Get('/')
-  async home(): Promise<string> {
-    return 'Hello Midwayjs!';
-  }
-}

+ 89 - 0
src/controller/system/dictData.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DictDataService } from '../../service/system/dictData.service';
+import {
+  CDTO_dictData,
+  CVO_dictData,
+  FVO_dictData,
+  QDTO_dictData,
+  QVO_dictData,
+  UDTO_dictData,
+  UVAO_dictData,
+} from '../../interface/system/dictData.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['字典表数据'])
+@Controller('/dictData')
+export class DictDataController extends BaseController {
+  @Inject()
+  service: DictDataService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dictData })
+  async create(@Body() data: CDTO_dictData) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dictData(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dictData })
+  async query(
+    @Query() filter: QDTO_dictData,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_dictData(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dictData })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dictData(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dictData })
+  async update(@Param('id') id: string, @Body() body: UDTO_dictData) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 89 - 0
src/controller/system/dictType.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { DictTypeService } from '../../service/system/dictType.service';
+import {
+  CDTO_dictType,
+  CVO_dictType,
+  FVO_dictType,
+  QDTO_dictType,
+  QVO_dictType,
+  UDTO_dictType,
+  UVAO_dictType,
+} from '../../interface/system/dictType.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['字典表类型'])
+@Controller('/dictType')
+export class DictTypeController extends BaseController {
+  @Inject()
+  service: DictTypeService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_dictType })
+  async create(@Body() data: CDTO_dictType) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_dictType(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_dictType })
+  async query(
+    @Query() filter: QDTO_dictType,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_dictType(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_dictType })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_dictType(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_dictType })
+  async update(@Param('id') id: string, @Body() body: UDTO_dictType) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 89 - 0
src/controller/system/menus.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { MenusService } from '../../service/system/menus.service';
+import {
+  CDTO_menus,
+  CVO_menus,
+  FVO_menus,
+  QDTO_menus,
+  QVO_menus,
+  UDTO_menus,
+  UVAO_menus,
+} from '../../interface/system/menus.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['菜单'])
+@Controller('/menus')
+export class MenusController extends BaseController {
+  @Inject()
+  service: MenusService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_menus })
+  async create(@Body() data: CDTO_menus) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_menus(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_menus })
+  async query(
+    @Query() filter: QDTO_menus,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_menus(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_menus })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_menus(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_menus })
+  async update(@Param('id') id: string, @Body() body: UDTO_menus) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 89 - 0
src/controller/system/module.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { ModuleService } from '../../service/system/module.service';
+import {
+  CDTO_module,
+  CVO_module,
+  FVO_module,
+  QDTO_module,
+  QVO_module,
+  UDTO_module,
+  UVAO_module,
+} from '../../interface/system/module.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['模块'])
+@Controller('/module')
+export class ModuleController extends BaseController {
+  @Inject()
+  service: ModuleService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_module })
+  async create(@Body() data: CDTO_module) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_module(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_module })
+  async query(
+    @Query() filter: QDTO_module,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_module(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_module })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_module(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_module })
+  async update(@Param('id') id: string, @Body() body: UDTO_module) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 89 - 0
src/controller/system/role.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { RoleService } from '../../service/system/role.service';
+import {
+  CDTO_role,
+  CVO_role,
+  FVO_role,
+  QDTO_role,
+  QVO_role,
+  UDTO_role,
+  UVAO_role,
+} from '../../interface/system/role.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['角色'])
+@Controller('/role')
+export class RoleController extends BaseController {
+  @Inject()
+  service: RoleService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_role })
+  async create(@Body() data: CDTO_role) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_role(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_role })
+  async query(
+    @Query() filter: QDTO_role,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_role(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_role })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_role(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_role })
+  async update(@Param('id') id: string, @Body() body: UDTO_role) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 89 - 0
src/controller/user/admin.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { AdminService } from '../../service/user/admin.service';
+import {
+  CDTO_admin,
+  CVO_admin,
+  FVO_admin,
+  QDTO_admin,
+  QVO_admin,
+  UDTO_admin,
+  UVAO_admin,
+} from '../../interface/user/admin.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['管理员表'])
+@Controller('/admin')
+export class AdminController extends BaseController {
+  @Inject()
+  service: AdminService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_admin })
+  async create(@Body() data: CDTO_admin) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_admin(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_admin })
+  async query(
+    @Query() filter: QDTO_admin,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_admin(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_admin })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_admin(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_admin })
+  async update(@Param('id') id: string, @Body() body: UDTO_admin) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 89 - 0
src/controller/user/personal.controller.ts

@@ -0,0 +1,89 @@
+import {
+  Body,
+  Controller,
+  Del,
+  Get,
+  Inject,
+  Param,
+  Post,
+  Query,
+} from '@midwayjs/decorator';
+import { BaseController } from 'free-midway-component';
+import { PersonalService } from '../../service/user/personal.service';
+import {
+  CDTO_personal,
+  CVO_personal,
+  FVO_personal,
+  QDTO_personal,
+  QVO_personal,
+  UDTO_personal,
+  UVAO_personal,
+} from '../../interface/user/personal.interface';
+import { ApiResponse, ApiTags, ApiQuery } from '@midwayjs/swagger';
+import { Validate } from '@midwayjs/validate';
+@ApiTags(['个人用户'])
+@Controller('/personal')
+export class PersonalController extends BaseController {
+  @Inject()
+  service: PersonalService;
+
+  @Post('/')
+  @Validate()
+  @ApiResponse({ type: CVO_personal })
+  async create(@Body() data: CDTO_personal) {
+    const dbData = await this.service.create(data);
+    const result = new CVO_personal(dbData);
+    return result;
+  }
+  @Get('/')
+  @ApiQuery({ name: 'query' })
+  @ApiResponse({ type: QVO_personal })
+  async query(
+    @Query() filter: QDTO_personal,
+    @Query('skip') skip: number,
+    @Query('limit') limit: number
+  ) {
+    const list = await this.service.query(filter, { skip, limit });
+    const data = [];
+    for (const i of list) {
+      const newData = new QVO_personal(i);
+      data.push(newData);
+    }
+    const total = await this.service.count(filter);
+    return { data, total };
+  }
+
+  @Get('/:id')
+  @ApiResponse({ type: FVO_personal })
+  async fetch(@Param('id') id: string) {
+    const data = await this.service.fetch(id);
+    const result = new FVO_personal(data);
+    return result;
+  }
+
+  @Post('/:id')
+  @Validate()
+  @ApiResponse({ type: UVAO_personal })
+  async update(@Param('id') id: string, @Body() body: UDTO_personal) {
+    const result = await this.service.updateOne(id, body);
+    return result;
+  }
+
+  @Del('/:id')
+  @Validate()
+  async delete(@Param('id') id: string) {
+    await this.service.delete(id);
+    return 'ok';
+  }
+  async createMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async updateMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+
+  async deleteMany(...args: any[]) {
+    throw new Error('Method not implemented.');
+  }
+}

+ 23 - 0
src/entity/system/dictData.entity.ts

@@ -0,0 +1,23 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dictData' },
+})
+export class DictData extends BaseModel {
+  @prop({ required: false, index: false, zh: '字典类型' })
+  type: string;
+  @prop({ required: false, index: false, zh: '字典标签' })
+  label: string;
+  @prop({ required: false, index: false, zh: '字典键值' })
+  value: string;
+  @prop({ required: false, index: false, zh: '排序', default: '0' })
+  sort: number;
+  @prop({
+    required: false,
+    index: false,
+    zh: '是否启用',
+    remark: '字典表:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 20 - 0
src/entity/system/dictType.entity.ts

@@ -0,0 +1,20 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'dictType' },
+})
+export class DictType extends BaseModel {
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '类型' })
+  type: string;
+  @prop({ required: false, index: true, zh: '备注' })
+  remark: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否启用',
+    remark: '字典表:common_type',
+  })
+  is_use: string;
+}

+ 40 - 0
src/entity/system/menus.entity.ts

@@ -0,0 +1,40 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'menus' },
+})
+export class Menus extends BaseModel {
+  @prop({ required: false, index: true, zh: '菜单名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '模块id' })
+  module_id: string;
+  @prop({ required: false, index: true, zh: '父级菜单' })
+  parent_id: string;
+  @prop({ required: false, index: true, zh: '路由地址' })
+  path: string;
+  @prop({ required: false, index: true, zh: '组件地址' })
+  component: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '菜单类型',
+    remark: '字典:menus_type',
+  })
+  type: string;
+  @prop({ required: false, index: true, zh: '图标' })
+  icon: string;
+  @prop({ required: false, index: false, zh: '设置' })
+  config: object;
+  @prop({ required: false, index: true, zh: '显示顺序' })
+  sort: string;
+  @prop({ required: false, index: false, zh: '备注' })
+  remark: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否使用',
+    remark: '字典表:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 21 - 0
src/entity/system/module.entity.ts

@@ -0,0 +1,21 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'module' },
+})
+export class Module extends BaseModel {
+  @prop({ required: false, index: true, zh: '模块名称' })
+  name: string;
+  @prop({ required: false, index: false, zh: '模块地址' })
+  url: string;
+  @prop({ required: false, index: false, zh: '模块简介' })
+  brief: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否使用',
+    remark: '字典表:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 25 - 0
src/entity/system/role.entity.ts

@@ -0,0 +1,25 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'role' },
+})
+export class Role extends BaseModel {
+  @prop({ required: false, index: true, zh: '角色名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '角色编码' })
+  code: string;
+  @prop({ required: false, index: false, zh: '简介' })
+  brief: string;
+  @prop({ required: false, index: false, zh: '菜单' })
+  menu: Array<any>;
+  @prop({ required: false, index: true, zh: '账号类型' })
+  account_type: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '是否使用',
+    remark: '字典表:common_use',
+    default: '0',
+  })
+  is_use: string;
+}

+ 35 - 0
src/entity/user/admin.entity.ts

@@ -0,0 +1,35 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'admin' },
+})
+export class Admin extends BaseModel {
+  @prop({ required: false, index: true, zh: '所属上级' })
+  pid: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '用户类型',
+    remark: '0:超级管理员,1:管理员,2:机构用户,3:业务用户',
+  })
+  type: string;
+  @prop({
+    required: false,
+    index: true,
+    zh: '邀请码',
+    remark: '字典表:account_code',
+  })
+  code: string;
+  @prop({ required: false, index: true, zh: '账号' })
+  account: string;
+  @prop({ required: false, index: false, zh: '密码' })
+  password: string;
+  @prop({ required: false, index: true, zh: '名称' })
+  name: string;
+  @prop({ required: false, index: true, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: true, zh: '机构名称' })
+  dept_name: string;
+  @prop({ required: false, index: true, zh: '角色' })
+  role: Array<any>;
+}

+ 50 - 0
src/entity/user/personal.entity.ts

@@ -0,0 +1,50 @@
+import { modelOptions, prop } from '@typegoose/typegoose';
+import { BaseModel } from 'free-midway-component';
+@modelOptions({
+  schemaOptions: { collection: 'personal' },
+})
+export class Personal extends BaseModel {
+  @prop({ required: false, index: false, zh: '用户类型', default: '3' })
+  type: string;
+  @prop({ required: false, index: false, zh: '邀请码' })
+  code: string;
+  @prop({ required: false, index: false, zh: '账号' })
+  account: string;
+  @prop({ required: false, index: false, zh: '密码' })
+  password: string;
+  @prop({ required: false, index: false, zh: '姓名' })
+  name: string;
+  @prop({ required: false, index: false, zh: '手机号' })
+  phone: string;
+  @prop({ required: false, index: false, zh: '电子邮箱' })
+  email: string;
+  @prop({ required: false, index: false, zh: '联系地址' })
+  address: string;
+  @prop({ required: false, index: false, zh: '办公电话' })
+  work_phone: string;
+  @prop({ required: false, index: false, zh: '所属行业' })
+  industry: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '所属辖区',
+    remark: '字典表:jl_area',
+  })
+  area: string;
+  @prop({ required: false, index: false, zh: '身份证号' })
+  card: string;
+  @prop({ required: false, index: false, zh: '职务职称' })
+  zwzc: string;
+  @prop({ required: false, index: false, zh: '所在院系' })
+  school: string;
+  @prop({ required: false, index: false, zh: '所学专业' })
+  major: string;
+  @prop({
+    required: false,
+    index: false,
+    zh: '状态',
+    remark: '字典表:common_status',
+    default: '0',
+  })
+  status: string;
+}

+ 81 - 0
src/interface/system/dictData.interface.ts

@@ -0,0 +1,81 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_dictData {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '字典类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '字典标签' })
+  'label': string = undefined;
+  @ApiProperty({ description: '字典键值' })
+  'value': string = undefined;
+  @ApiProperty({ description: '排序' })
+  'sort': number = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_dictData extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+}
+
+export class QVO_dictData extends FVO_dictData {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dictData {
+  @ApiProperty({ description: '字典类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '字典标签' })
+  @Rule(RuleType['string']().empty(''))
+  'label': string = undefined;
+  @ApiProperty({ description: '字典键值' })
+  @Rule(RuleType['string']().empty(''))
+  'value': string = undefined;
+  @ApiProperty({ description: '排序' })
+  @Rule(RuleType['number']().empty(''))
+  'sort': number = undefined;
+  @ApiProperty({ description: '是否启用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_dictData extends FVO_dictData {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dictData extends CDTO_dictData {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dictData extends FVO_dictData {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 84 - 0
src/interface/system/dictType.interface.ts

@@ -0,0 +1,84 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_dictType {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '备注' })
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_dictType extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['name', 'type', 'remark', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '备注' })
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_dictType extends FVO_dictType {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_dictType {
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '备注' })
+  @Rule(RuleType['string']().empty(''))
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否启用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_dictType extends FVO_dictType {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_dictType extends CDTO_dictType {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_dictType extends FVO_dictType {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 139 - 0
src/interface/system/menus.interface.ts

@@ -0,0 +1,139 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_menus {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '菜单名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '模块id' })
+  'module_id': string = undefined;
+  @ApiProperty({ description: '父级菜单' })
+  'parent_id': string = undefined;
+  @ApiProperty({ description: '路由地址' })
+  'path': string = undefined;
+  @ApiProperty({ description: '组件地址' })
+  'component': string = undefined;
+  @ApiProperty({ description: '菜单类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '图标' })
+  'icon': string = undefined;
+  @ApiProperty({ description: '设置' })
+  'config': object = undefined;
+  @ApiProperty({ description: '显示顺序' })
+  'sort': string = undefined;
+  @ApiProperty({ description: '备注' })
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_menus extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'name',
+      'module_id',
+      'parent_id',
+      'path',
+      'component',
+      'type',
+      'icon',
+      'sort',
+      'is_use',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '菜单名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '模块id' })
+  'module_id': string = undefined;
+  @ApiProperty({ description: '父级菜单' })
+  'parent_id': string = undefined;
+  @ApiProperty({ description: '路由地址' })
+  'path': string = undefined;
+  @ApiProperty({ description: '组件地址' })
+  'component': string = undefined;
+  @ApiProperty({ description: '菜单类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '图标' })
+  'icon': string = undefined;
+  @ApiProperty({ description: '显示顺序' })
+  'sort': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_menus extends FVO_menus {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_menus {
+  @ApiProperty({ description: '菜单名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '模块id' })
+  @Rule(RuleType['string']().empty(''))
+  'module_id': string = undefined;
+  @ApiProperty({ description: '父级菜单' })
+  @Rule(RuleType['string']().empty(''))
+  'parent_id': string = undefined;
+  @ApiProperty({ description: '路由地址' })
+  @Rule(RuleType['string']().empty(''))
+  'path': string = undefined;
+  @ApiProperty({ description: '组件地址' })
+  @Rule(RuleType['string']().empty(''))
+  'component': string = undefined;
+  @ApiProperty({ description: '菜单类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '图标' })
+  @Rule(RuleType['string']().empty(''))
+  'icon': string = undefined;
+  @ApiProperty({ description: '设置' })
+  @Rule(RuleType['object']().empty(''))
+  'config': object = undefined;
+  @ApiProperty({ description: '显示顺序' })
+  @Rule(RuleType['string']().empty(''))
+  'sort': string = undefined;
+  @ApiProperty({ description: '备注' })
+  @Rule(RuleType['string']().empty(''))
+  'remark': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_menus extends FVO_menus {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_menus extends CDTO_menus {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_menus extends FVO_menus {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 80 - 0
src/interface/system/module.interface.ts

@@ -0,0 +1,80 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_module {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '模块名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '模块地址' })
+  'url': string = undefined;
+  @ApiProperty({ description: '模块简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_module extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['name', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '模块名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_module extends FVO_module {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_module {
+  @ApiProperty({ description: '模块名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '模块地址' })
+  @Rule(RuleType['string']().empty(''))
+  'url': string = undefined;
+  @ApiProperty({ description: '模块简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_module extends FVO_module {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_module extends CDTO_module {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_module extends FVO_module {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 94 - 0
src/interface/system/role.interface.ts

@@ -0,0 +1,94 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_role {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '角色名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '角色编码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '简介' })
+  'brief': string = undefined;
+  @ApiProperty({ description: '菜单' })
+  'menu': Array<any> = undefined;
+  @ApiProperty({ description: '账号类型' })
+  'account_type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QDTO_role extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = ['name', 'code', 'account_type', 'is_use'];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '角色名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '角色编码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号类型' })
+  'account_type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  'is_use': string = undefined;
+}
+
+export class QVO_role extends FVO_role {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_role {
+  @ApiProperty({ description: '角色名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '角色编码' })
+  @Rule(RuleType['string']().empty(''))
+  'code': string = undefined;
+  @ApiProperty({ description: '简介' })
+  @Rule(RuleType['string']().empty(''))
+  'brief': string = undefined;
+  @ApiProperty({ description: '菜单' })
+  @Rule(RuleType['array']().empty(''))
+  'menu': Array<any> = undefined;
+  @ApiProperty({ description: '账号类型' })
+  @Rule(RuleType['string']().empty(''))
+  'account_type': string = undefined;
+  @ApiProperty({ description: '是否使用' })
+  @Rule(RuleType['string']().empty(''))
+  'is_use': string = undefined;
+}
+
+export class CVO_role extends FVO_role {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_role extends CDTO_role {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_role extends FVO_role {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 126 - 0
src/interface/user/admin.interface.ts

@@ -0,0 +1,126 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_admin {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '所属上级' })
+  'pid': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '机构名称' })
+  'dept_name': string = undefined;
+  @ApiProperty({ description: '角色' })
+  'role': Array<any> = undefined;
+}
+
+export class QDTO_admin extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [
+      'pid',
+      'type',
+      'code',
+      'account',
+      'name',
+      'phone',
+      'dept_name',
+      'role',
+    ];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+  @ApiProperty({ description: '所属上级' })
+  'pid': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '名称' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '机构名称' })
+  'dept_name': string = undefined;
+  @ApiProperty({ description: '角色' })
+  'role': Array<any> = undefined;
+}
+
+export class QVO_admin extends FVO_admin {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_admin {
+  @ApiProperty({ description: '所属上级' })
+  @Rule(RuleType['string']().empty(''))
+  'pid': string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  @Rule(RuleType['string']().empty(''))
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+  @ApiProperty({ description: '名称' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '机构名称' })
+  @Rule(RuleType['string']().empty(''))
+  'dept_name': string = undefined;
+  @ApiProperty({ description: '角色' })
+  @Rule(RuleType['array']().empty(''))
+  'role': Array<any> = undefined;
+}
+
+export class CVO_admin extends FVO_admin {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_admin extends CDTO_admin {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_admin extends FVO_admin {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 136 - 0
src/interface/user/personal.interface.ts

@@ -0,0 +1,136 @@
+import { Rule, RuleType } from '@midwayjs/validate';
+import { ApiProperty } from '@midwayjs/swagger';
+import { SearchBase } from 'free-midway-component';
+import get = require('lodash/get');
+const dealVO = (cla, data) => {
+  for (const key in cla) {
+    const val = get(data, key);
+    if (val || val === 0) cla[key] = val;
+  }
+};
+export class FVO_personal {
+  constructor(data: object) {
+    dealVO(this, data);
+  }
+  @ApiProperty({ description: '数据id' })
+  _id: string = undefined;
+  @ApiProperty({ description: '用户类型' })
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  'area': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  'card': string = undefined;
+  @ApiProperty({ description: '职务职称' })
+  'zwzc': string = undefined;
+  @ApiProperty({ description: '所在院系' })
+  'school': string = undefined;
+  @ApiProperty({ description: '所学专业' })
+  'major': string = undefined;
+  @ApiProperty({ description: '状态' })
+  'status': string = undefined;
+}
+
+export class QDTO_personal extends SearchBase {
+  constructor() {
+    const like_prop = [];
+    const props = [];
+    const mapping = [];
+    super({ like_prop, props, mapping });
+  }
+}
+
+export class QVO_personal extends FVO_personal {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class CDTO_personal {
+  @ApiProperty({ description: '用户类型' })
+  @Rule(RuleType['string']().empty(''))
+  'type': string = undefined;
+  @ApiProperty({ description: '邀请码' })
+  @Rule(RuleType['string']().empty(''))
+  'code': string = undefined;
+  @ApiProperty({ description: '账号' })
+  @Rule(RuleType['string']().empty(''))
+  'account': string = undefined;
+  @ApiProperty({ description: '密码' })
+  @Rule(RuleType['string']().empty(''))
+  'password': string = undefined;
+  @ApiProperty({ description: '姓名' })
+  @Rule(RuleType['string']().empty(''))
+  'name': string = undefined;
+  @ApiProperty({ description: '手机号' })
+  @Rule(RuleType['string']().empty(''))
+  'phone': string = undefined;
+  @ApiProperty({ description: '电子邮箱' })
+  @Rule(RuleType['string']().empty(''))
+  'email': string = undefined;
+  @ApiProperty({ description: '联系地址' })
+  @Rule(RuleType['string']().empty(''))
+  'address': string = undefined;
+  @ApiProperty({ description: '办公电话' })
+  @Rule(RuleType['string']().empty(''))
+  'work_phone': string = undefined;
+  @ApiProperty({ description: '所属行业' })
+  @Rule(RuleType['string']().empty(''))
+  'industry': string = undefined;
+  @ApiProperty({ description: '所属辖区' })
+  @Rule(RuleType['string']().empty(''))
+  'area': string = undefined;
+  @ApiProperty({ description: '身份证号' })
+  @Rule(RuleType['string']().empty(''))
+  'card': string = undefined;
+  @ApiProperty({ description: '职务职称' })
+  @Rule(RuleType['string']().empty(''))
+  'zwzc': string = undefined;
+  @ApiProperty({ description: '所在院系' })
+  @Rule(RuleType['string']().empty(''))
+  'school': string = undefined;
+  @ApiProperty({ description: '所学专业' })
+  @Rule(RuleType['string']().empty(''))
+  'major': string = undefined;
+  @ApiProperty({ description: '状态' })
+  @Rule(RuleType['string']().empty(''))
+  'status': string = undefined;
+}
+
+export class CVO_personal extends FVO_personal {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}
+
+export class UDTO_personal extends CDTO_personal {
+  @ApiProperty({ description: '数据id' })
+  @Rule(RuleType['string']().empty(''))
+  _id: string = undefined;
+}
+
+export class UVAO_personal extends FVO_personal {
+  constructor(data: object) {
+    super(data);
+    dealVO(this, data);
+  }
+}

+ 11 - 0
src/service/system/dictData.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DictData } from '../../entity/system/dictData.entity';
+type modelType = ReturnModelType<typeof DictData>;
+@Provide()
+export class DictDataService extends BaseService<modelType> {
+  @InjectEntityModel(DictData)
+  model: modelType;
+}

+ 11 - 0
src/service/system/dictType.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { DictType } from '../../entity/system/dictType.entity';
+type modelType = ReturnModelType<typeof DictType>;
+@Provide()
+export class DictTypeService extends BaseService<modelType> {
+  @InjectEntityModel(DictType)
+  model: modelType;
+}

+ 11 - 0
src/service/system/menus.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Menus } from '../../entity/system/menus.entity';
+type modelType = ReturnModelType<typeof Menus>;
+@Provide()
+export class MenusService extends BaseService<modelType> {
+  @InjectEntityModel(Menus)
+  model: modelType;
+}

+ 11 - 0
src/service/system/module.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Module } from '../../entity/system/module.entity';
+type modelType = ReturnModelType<typeof Module>;
+@Provide()
+export class ModuleService extends BaseService<modelType> {
+  @InjectEntityModel(Module)
+  model: modelType;
+}

+ 11 - 0
src/service/system/role.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Role } from '../../entity/system/role.entity';
+type modelType = ReturnModelType<typeof Role>;
+@Provide()
+export class RoleService extends BaseService<modelType> {
+  @InjectEntityModel(Role)
+  model: modelType;
+}

+ 0 - 14
src/service/user.service.ts

@@ -1,14 +0,0 @@
-import { Provide } from '@midwayjs/core';
-import { IUserOptions } from '../interface';
-
-@Provide()
-export class UserService {
-  async getUser(options: IUserOptions) {
-    return {
-      uid: options.uid,
-      username: 'mockedName',
-      phone: '12345678901',
-      email: 'xxx.xxx@xxx.com',
-    };
-  }
-}

+ 11 - 0
src/service/user/admin.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Admin } from '../../entity/user/admin.entity';
+type modelType = ReturnModelType<typeof Admin>;
+@Provide()
+export class AdminService extends BaseService<modelType> {
+  @InjectEntityModel(Admin)
+  model: modelType;
+}

+ 11 - 0
src/service/user/personal.service.ts

@@ -0,0 +1,11 @@
+import { Provide } from '@midwayjs/decorator';
+import { InjectEntityModel } from '@midwayjs/typegoose';
+import { ReturnModelType } from '@typegoose/typegoose';
+import { BaseService } from 'free-midway-component';
+import { Personal } from '../../entity/user/personal.entity';
+type modelType = ReturnModelType<typeof Personal>;
+@Provide()
+export class PersonalService extends BaseService<modelType> {
+  @InjectEntityModel(Personal)
+  model: modelType;
+}