lrf402788946 3 years ago
commit
139a851565

+ 29 - 0
.autod.conf.js

@@ -0,0 +1,29 @@
+'use strict';
+
+module.exports = {
+  write: true,
+  prefix: '^',
+  plugin: 'autod-egg',
+  test: [
+    'test',
+    'benchmark',
+  ],
+  dep: [
+    'egg',
+    'egg-scripts',
+  ],
+  devdep: [
+    'egg-ci',
+    'egg-bin',
+    'egg-mock',
+    'autod',
+    'autod-egg',
+    'eslint',
+    'eslint-config-egg',
+  ],
+  exclude: [
+    './test/fixtures',
+    './dist',
+  ],
+};
+

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+coverage

+ 3 - 0
.eslintrc

@@ -0,0 +1,3 @@
+{
+  "extends": "eslint-config-egg"
+}

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+logs/
+npm-debug.log
+yarn-error.log
+node_modules/
+package-lock.json
+yarn.lock
+coverage/
+.idea/
+run/
+.DS_Store
+*.sw*
+*.un~
+typings/
+.nyc_output/

+ 33 - 0
README.md

@@ -0,0 +1,33 @@
+# server-haocai
+
+耗材服务端
+
+## QuickStart
+
+<!-- add docs here for user -->
+
+see [egg docs][egg] for more detail.
+
+### Development
+
+```bash
+$ npm i
+$ npm run dev
+$ open http://localhost:7001/
+```
+
+### Deploy
+
+```bash
+$ npm start
+$ npm stop
+```
+
+### npm scripts
+
+- Use `npm run lint` to check code style.
+- Use `npm test` to run unit test.
+- Use `npm run autod` to auto detect dependencies upgrade, see [autod](https://www.npmjs.com/package/autod) for more detail.
+
+
+[egg]: https://eggjs.org

+ 64 - 0
app/controller/.examine.js

@@ -0,0 +1,64 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "personal",
+      "examine_time",
+      "opinion",
+      "status",
+      "totalMoney",
+      "order",
+      "buy_id",
+      "buy_name",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "personal",
+      "examine_time",
+      "opinion",
+      "status",
+      "totalMoney",
+      "order",
+      "buy_id",
+      "buy_name",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        personal: "personal",
+        mech_id: "order.mech_id",
+        status: "status",
+        totalMoney: "totalMoney",
+        buy_id: "buy_id",
+        buy_name: "%buy_name%",
+        "examine_time@start": "examine_time@start",
+        "examine_time@end": "examine_time@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  getGoods: {
+    requestBody: ["examine_id", "buy_id", "mech_id", "market_id", "status"],
+  },
+};

+ 61 - 0
app/controller/.market.js

@@ -0,0 +1,61 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "mech_id",
+      "mech_name",
+      "type",
+      "name",
+      "brief",
+      "money",
+      "img_url",
+      "status",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "mech_id",
+      "mech_name",
+      "type",
+      "name",
+      "brief",
+      "money",
+      "img_url",
+      "status",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        mech_id: "mech_id",
+        mech_name: "%mech_name%",
+        type: "type",
+        name: "%name%",
+        money: "money",
+        status: "status",
+        "meta.createdAt@start": "meta.createdAt@start",
+        "meta.createdAt@end": "meta.createdAt@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+};

+ 82 - 0
app/controller/.user.js

@@ -0,0 +1,82 @@
+module.exports = {
+  create: {
+    requestBody: [
+      "name",
+      "phone",
+      "password",
+      "email",
+      "address",
+      "dept",
+      "zw",
+      "company",
+      "type",
+      "openid",
+      "remark",
+    ],
+  },
+  destroy: {
+    params: ["!id"],
+    service: "delete",
+  },
+  update: {
+    params: ["!id"],
+    requestBody: [
+      "name",
+      "phone",
+      "email",
+      "address",
+      "dept",
+      "zw",
+      "company",
+      "type",
+      "openid",
+      "remark",
+    ],
+  },
+  show: {
+    parameters: {
+      params: ["!id"],
+    },
+    service: "fetch",
+  },
+  index: {
+    parameters: {
+      query: {
+        name: "%name%",
+        phone: "%phone%",
+        email: "%email%",
+        address: "%address%",
+        dept: "%dept%",
+        zw: "%zw%",
+        company: "%company%",
+        type: "%type%",
+        openid: "%openid%",
+        "meta.createdAt@start": "meta.createdAt@start",
+        "meta.createdAt@end": "meta.createdAt@end",
+      },
+      // options: {
+      //   "meta.state": 0 // 默认条件
+      // },
+    },
+    service: "query",
+    options: {
+      query: ["skip", "limit"],
+      sort: ["meta.createdAt"],
+      desc: true,
+      count: true,
+    },
+  },
+  login:{
+    requestBody: [
+      "phone",
+      "password",
+      "openid",
+    ],
+  },
+  password:{
+    requestBody: [
+      "id",
+      "password",
+    ],
+  }
+};

+ 12 - 0
app/controller/examine.js

@@ -0,0 +1,12 @@
+'use strict';
+const meta = require('./.examine.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+class ExamineController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.examine;
+  }
+}
+module.exports = CrudController(ExamineController, meta);

+ 12 - 0
app/controller/home.js

@@ -0,0 +1,12 @@
+'use strict';
+
+const Controller = require('egg').Controller;
+
+class HomeController extends Controller {
+  async index() {
+    const { ctx } = this;
+    ctx.body = 'hi, egg';
+  }
+}
+
+module.exports = HomeController;

+ 12 - 0
app/controller/market.js

@@ -0,0 +1,12 @@
+'use strict';
+const meta = require('./.market.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+class MarketController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.market;
+  }
+}
+module.exports = CrudController(MarketController, meta);

+ 12 - 0
app/controller/user.js

@@ -0,0 +1,12 @@
+'use strict';
+const meta = require('./.user.js');
+const Controller = require('egg').Controller;
+const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
+
+class UserController extends Controller {
+  constructor(ctx) {
+    super(ctx);
+    this.service = this.ctx.service.user;
+  }
+}
+module.exports = CrudController(UserController, meta);

+ 30 - 0
app/model/examine.js

@@ -0,0 +1,30 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+const { ObjectId } = require('mongoose').Types;
+// 审批表
+const examine = {
+  personal: { type: ObjectId }, // 审批人
+  examine_time: { type: String }, // 审批时间
+  opinion: { type: String }, // 审批意见
+  status: { type: String }, // 审批结果 【0:待审中,1:审核通过,2:审核未通过】
+  totalMoney: { type: Number }, // 购买总价
+  order: { type: Array }, // 订单数组
+  buy_id: { type: ObjectId }, // 购买人id
+  buy_name: { type: String }, // 购买人姓名
+  remark: { type: String }, //
+};
+const schema = new Schema(examine, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ personal: 1 });
+schema.index({ examine_time: 1 });
+schema.index({ status: 1 });
+schema.index({ totalMoney: 1 });
+schema.index({ buy_id: 1 });
+schema.index({ buy_name: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Examine', schema, 'examine');
+};

+ 30 - 0
app/model/market.js

@@ -0,0 +1,30 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+const { ObjectId } = require('mongoose').Types;
+// 商品表
+const market = {
+  mech_id: { type: ObjectId }, // 商户id
+  mech_name: { type: String }, // 商户名称
+  type: { type: String }, // 分类
+  name: { type: String }, // 商品名称
+  brief: { type: String }, // 简介
+  money: { type: Number }, // 单价
+  img_url: { type: Array }, // 图片
+  status: { type: String }, // 状态 【0:待上架,1:上架,2:下架,3:删除】
+  remark: { type: String },
+};
+const schema = new Schema(market, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ mech_id: 1 });
+schema.index({ mech_name: 1 });
+schema.index({ type: 1 });
+schema.index({ name: 1 });
+schema.index({ money: 1 });
+schema.index({ status: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('Market', schema, 'market');
+};

+ 34 - 0
app/model/user.js

@@ -0,0 +1,34 @@
+'use strict';
+const Schema = require('mongoose').Schema;
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
+const { Secret } = require('naf-framework-mongoose-free/lib/model/schema');
+// 用户表
+const user = {
+  name: { type: String }, // 姓名
+  phone: { type: String }, // 电话
+  password: { type: Secret, select: false }, // 密码
+  email: { type: String }, // 邮箱
+  address: { type: String }, // 地址
+  dept: { type: String }, // 部门
+  zw: { type: String }, // 职务
+  company: { type: String }, // 工作单位
+  type: { type: String }, // 类型【0:管理员,1:商户,2:用户】
+  openid: { type: String }, // 微信openid
+  remark: { type: String },
+};
+const schema = new Schema(user, { toJSON: { virtuals: true } });
+schema.index({ id: 1 });
+schema.index({ name: 1 });
+schema.index({ phone: 1 });
+schema.index({ address: 1 });
+schema.index({ dept: 1 });
+schema.index({ zw: 1 });
+schema.index({ company: 1 });
+schema.index({ openid: 1 });
+schema.index({ type: 1 });
+schema.index({ 'meta.createdAt': 1 });
+schema.plugin(metaPlugin);
+module.exports = app => {
+  const { mongoose } = app;
+  return mongoose.model('User', schema, 'user');
+};

+ 12 - 0
app/router.js

@@ -0,0 +1,12 @@
+'use strict';
+
+/**
+ * @param {Egg.Application} app - egg application
+ */
+module.exports = app => {
+  const { router, controller } = app;
+  router.get('/', controller.home.index);
+  require('./z_router/user')(app); // 用户
+  require('./z_router/market')(app); // 商品
+  require('./z_router/examine')(app); // 审批
+};

+ 37 - 0
app/service/examine.js

@@ -0,0 +1,37 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+const { ObjectId } = require('mongoose').Types;
+
+// 审批
+class ExamineService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'examine');
+    this.model = this.ctx.model.Examine;
+  }
+
+  async getGoods({ examine_id, buy_id, mech_id, market_id, status }) {
+    assert(examine_id, '缺少审批表信息');
+    assert(buy_id, '缺少购买人信息');
+    assert(mech_id, '缺少商铺信息');
+    assert(market_id, '缺少商品信息');
+    assert(status, '缺少货物状态');
+    const query = {
+      _id: ObjectId(examine_id),
+      buy_id: ObjectId(buy_id),
+    };
+    let data = await this.model.findOne(query);
+    if (!data) BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到信息');
+    const i = data.order.findIndex(f => ObjectId(f.mech_id).equals(mech_id) && ObjectId(f.id).equals(market_id));
+    if (i < 0)BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到货物信息');
+    data.order[i].status = status;
+    data = _.omit(data, [ 'meta' ]);
+    data = JSON.parse(JSON.stringify(data));
+    const res = await this.model.updateOne(query, data);
+    return res;
+  }
+}
+
+module.exports = ExamineService;

+ 15 - 0
app/service/market.js

@@ -0,0 +1,15 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const assert = require('assert');
+
+// 商品
+class MarketService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'market');
+    this.model = this.ctx.model.Market;
+  }
+}
+
+module.exports = MarketService;

+ 62 - 0
app/service/user.js

@@ -0,0 +1,62 @@
+'use strict';
+const { CrudService } = require('naf-framework-mongoose-free/lib/service');
+const { BusinessError, ErrorCode } = require('naf-core').Error;
+const _ = require('lodash');
+const { ObjectId } = require('mongoose').Types;
+
+// 用户相关
+class UserService extends CrudService {
+  constructor(ctx) {
+    super(ctx, 'user');
+    this.model = this.ctx.model.User;
+  }
+
+
+  /**
+   * 创建用户
+   * @param {Object} params 用户信息
+   */
+  async create({ password, ...data }) {
+    data.password = { secret: password };
+    const { phone } = data;
+    // 检查手机号
+    const num = await this.model.count({ phone });
+    if (num > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '已有人员 使用该手机号');
+    const res = await this.model.create(data);
+    return res;
+  }
+
+  /**
+   * 修改密码
+   * @param {Object} {id,password} 用户id和密码
+   */
+  async password({ id, password }) {
+    const object = await this.model.findById(id);
+    if (!object) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户的信息');
+    object.password = { secret: password };
+    await object.save();
+  }
+
+  /**
+   * 管理员登陆
+   * @param {Object} params 登陆信息
+   * @property phone 电话号
+   * @property password 密码
+   */
+  async login({ phone, password, openid }) {
+    let object;
+    if (!openid) object = await this.model.findOne({ phone }, '+password');
+    else object = await this.model.findOne({ openid });
+    if (!object) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到用户的信息');
+    if (!openid) {
+      const { password: op } = object;
+      const { secret } = op;
+      if (secret !== password) throw new BusinessError(ErrorCode.BAD_PASSWORD, '密码错误');
+    }
+    const data = _.omit(JSON.parse(JSON.stringify(object)), [ 'meta', 'password', '__v' ]);
+    return data;
+  }
+
+}
+
+module.exports = UserService;

+ 11 - 0
app/z_router/examine.js

@@ -0,0 +1,11 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/hc/';
+  const target = 'examine';
+  router.post(target, `${profix}${target}/getGoods`, controller[target].getGoods);
+  router.resources(target, `${profix}${target}`, controller[target]); // index、create、show、destroy
+  router.post(target, `${profix}${target}/update/:id`, controller[target].update);
+};

+ 10 - 0
app/z_router/market.js

@@ -0,0 +1,10 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/hc/';
+  const target = 'market';
+  router.resources(target, `${profix}${target}`, controller[target]); // index、create、show、destroy
+  router.post(target, `${profix}${target}/update/:id`, controller[target].update);
+};

+ 12 - 0
app/z_router/user.js

@@ -0,0 +1,12 @@
+'use strict';
+
+
+module.exports = app => {
+  const { router, controller } = app;
+  const profix = '/api/hc/';
+  const target = 'user';
+  router.post(target, `${profix}${target}/login`, controller[target].login);
+  router.post(target, `${profix}${target}/password`, controller[target].password);
+  router.resources(target, `${profix}${target}`, controller[target]); // index、create、show、destroy
+  router.post(target, `${profix}${target}/update/:id`, controller[target].update);
+};

+ 47 - 0
config/config.default.js

@@ -0,0 +1,47 @@
+/* eslint valid-jsdoc: "off" */
+
+'use strict';
+
+/**
+ * @param {Egg.EggAppInfo} appInfo app info
+ */
+module.exports = appInfo => {
+  /**
+   * built-in config
+   * @type {Egg.EggAppConfig}
+   **/
+  const config = exports = {};
+
+  // use for cookie sign key, should change to your own and keep security
+  config.keys = appInfo.name + '_1634037788449_9702';
+
+  // add your middleware config here
+  config.middleware = [];
+
+  // add your user config here
+  const userConfig = {
+    // myAppName: 'egg',
+  };
+  config.cluster = {
+    listen: {
+      port: 12001,
+    },
+  };
+
+  config.dbName = 'hc';
+  config.mongoose = {
+    url: `mongodb://localhost:27017/${config.dbName}`,
+    options: {
+      // user: 'admin',
+      // pass: '111111',
+      // authSource: 'admin',
+      // useNewUrlParser: true,
+      // useCreateIndex: true,
+    },
+  };
+
+  return {
+    ...config,
+    ...userConfig,
+  };
+};

+ 9 - 0
config/plugin.js

@@ -0,0 +1,9 @@
+'use strict';
+
+/** @type Egg.EggPlugin */
+module.exports = {
+  // had enabled by egg
+  // static: {
+  //   enable: true,
+  // }
+};

+ 49 - 0
package.json

@@ -0,0 +1,49 @@
+{
+  "name": "server-haocai",
+  "version": "1.0.0",
+  "description": "耗材服务端",
+  "private": true,
+  "egg": {
+    "framework": "naf-framework-mongoose-free"
+  },
+  "dependencies": {
+    "egg": "^2.15.1",
+    "egg-scripts": "^2.11.0",
+    "lodash": "^4.17.21",
+    "moment": "^2.29.1",
+    "naf-framework-mongoose-free": "^0.0.2"
+  },
+  "devDependencies": {
+    "autod": "^3.0.1",
+    "autod-egg": "^1.1.0",
+    "egg-bin": "^4.11.0",
+    "egg-ci": "^1.11.0",
+    "egg-mock": "^3.21.0",
+    "eslint": "^5.13.0",
+    "eslint-config-egg": "^7.1.0"
+  },
+  "engines": {
+    "node": ">=10.0.0"
+  },
+  "scripts": {
+    "start": "egg-scripts start --daemon --title=egg-server-server-haocai",
+    "stop": "egg-scripts stop --title=egg-server-server-haocai",
+    "dev": "egg-bin dev",
+    "debug": "egg-bin debug",
+    "test": "npm run lint -- --fix && npm run test-local",
+    "test-local": "egg-bin test",
+    "cov": "egg-bin cov",
+    "lint": "eslint .",
+    "ci": "npm run lint && npm run cov",
+    "autod": "autod"
+  },
+  "ci": {
+    "version": "10"
+  },
+  "repository": {
+    "type": "git",
+    "url": ""
+  },
+  "author": "lrf",
+  "license": "MIT"
+}

+ 20 - 0
test/app/controller/home.test.js

@@ -0,0 +1,20 @@
+'use strict';
+
+const { app, assert } = require('egg-mock/bootstrap');
+
+describe('test/app/controller/home.test.js', () => {
+  it('should assert', () => {
+    const pkg = require('../../../package.json');
+    assert(app.config.keys.startsWith(pkg.name));
+
+    // const ctx = app.mockContext({});
+    // yield ctx.service.xx();
+  });
+
+  it('should GET /', () => {
+    return app.httpRequest()
+      .get('/')
+      .expect('hi, egg')
+      .expect(200);
+  });
+});

+ 152 - 0
接口.postman_collection.json

@@ -0,0 +1,152 @@
+{
+	"info": {
+		"_postman_id": "35a56a96-4c41-470c-9d03-26eae3570bfa",
+		"name": "耗材",
+		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+	},
+	"item": [
+		{
+			"name": "user",
+			"request": {
+				"method": "POST",
+				"header": [
+					{
+						"key": "Authorization",
+						"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YWJsZSI6InN5c3RlbV9hY2NvdW50IiwiaWQiOiIxIiwiaWF0IjoxNjMyODkzMjcxfQ.TBqoZhKsgPCflK2xpnKeskALeq2yrp8708Cjvars-zE",
+						"type": "text"
+					}
+				],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"name\":\"测试商户\",\r\n    \"phone\":\"13089419811\",\r\n    \"password\":\"1qaz2wsx\",\r\n    \"email\":\"2938260457@qq.com\",\r\n    \"address\":\"回家\",\r\n    \"dept\":\"回家部\",\r\n    \"zw\":\"回家\",\r\n    \"company\":\"回家单位\",\r\n    \"type\":\"1\",\r\n    \"openid\":\"485sqqafrtd5_2as\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/user",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"user"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "登陆",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"phone\":\"13089419810\",\r\n    \"password\":\"1qaz2wsx\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/user/login",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"user",
+						"login"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "market",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"mech_id\":\"61658239a649224d901195a6\",\r\n    \"mech_name\":\"测试商户\",\r\n    \"type\":\"吃\",\r\n    \"name\":\"饼干(大包)\",\r\n    \"brief\":\"压缩饼干\",\r\n    \"money\":20,\r\n    \"status\":\"0\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/market/update/6165829da649224d901195a8",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"market",
+						"update",
+						"6165829da649224d901195a8"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "examine",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"personal\":\"61658239a649224d901195a6\",\r\n    \"examine_time\":\"2021-09-10\",\r\n    \"opinion\":\"不能吃\",\r\n    \"status\":\"2\",\r\n    \"totalMoney\":60,\r\n    \"buy_id\":\"61658239a649224d901195a6\",\r\n    \"buy_name\":\"测试商户\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/examine/update/61658336a649224d901195af",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"examine",
+						"update",
+						"61658336a649224d901195af"
+					]
+				}
+			},
+			"response": []
+		}
+	]
+}

+ 186 - 0
耗材.postman_collection.json

@@ -0,0 +1,186 @@
+{
+	"info": {
+		"_postman_id": "35a56a96-4c41-470c-9d03-26eae3570bfa",
+		"name": "耗材",
+		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+	},
+	"item": [
+		{
+			"name": "user",
+			"request": {
+				"method": "POST",
+				"header": [
+					{
+						"key": "Authorization",
+						"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0YWJsZSI6InN5c3RlbV9hY2NvdW50IiwiaWQiOiIxIiwiaWF0IjoxNjMyODkzMjcxfQ.TBqoZhKsgPCflK2xpnKeskALeq2yrp8708Cjvars-zE",
+						"type": "text"
+					}
+				],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"name\":\"测试商户\",\r\n    \"phone\":\"13089419811\",\r\n    \"password\":\"1qaz2wsx\",\r\n    \"email\":\"2938260457@qq.com\",\r\n    \"address\":\"回家\",\r\n    \"dept\":\"回家部\",\r\n    \"zw\":\"回家\",\r\n    \"company\":\"回家单位\",\r\n    \"type\":\"1\",\r\n    \"openid\":\"485sqqafrtd5_2as\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/user",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"user"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "登陆",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"phone\":\"13089419810\",\r\n    \"password\":\"1qaz2wsx\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/user/login",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"user",
+						"login"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "market",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"mech_id\":\"61658239a649224d901195a6\",\r\n    \"mech_name\":\"测试商户\",\r\n    \"type\":\"吃\",\r\n    \"name\":\"饼干(大包)\",\r\n    \"brief\":\"压缩饼干\",\r\n    \"money\":20,\r\n    \"status\":\"0\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/market/update/6165829da649224d901195a8",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"market",
+						"update",
+						"6165829da649224d901195a8"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "examine",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"personal\":\"61658239a649224d901195a6\",\r\n    \"examine_time\":\"2021-09-10\",\r\n    \"opinion\":\"不能吃\",\r\n    \"status\":\"2\",\r\n    \"totalMoney\":60,\r\n    \"buy_id\":\"61658239a649224d901195a6\",\r\n    \"buy_name\":\"测试商户\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/examine/update/61658336a649224d901195af",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"examine",
+						"update",
+						"61658336a649224d901195af"
+					]
+				}
+			},
+			"response": []
+		},
+		{
+			"name": "收货",
+			"request": {
+				"method": "POST",
+				"header": [],
+				"body": {
+					"mode": "raw",
+					"raw": "{\r\n    \"examine_id\":\"61658336a649224d901195af\",\r\n    \"buy_id\":\"61658239a649224d901195a6\",\r\n    \"mech_id\":\"61658239a649224d901195a7\",\r\n    \"market_id\":\"6165829da649224d901195a8\",\r\n    \"status\":\"1\"\r\n}",
+					"options": {
+						"raw": {
+							"language": "json"
+						}
+					}
+				},
+				"url": {
+					"raw": "http://127.0.0.1:12001/api/hc/examine/getGoods",
+					"protocol": "http",
+					"host": [
+						"127",
+						"0",
+						"0",
+						"1"
+					],
+					"port": "12001",
+					"path": [
+						"api",
+						"hc",
+						"examine",
+						"getGoods"
+					]
+				}
+			},
+			"response": []
+		}
+	]
+}