|
|
@ -0,0 +1,21 @@ |
|
|
|
const { |
|
|
|
getConfigByHouseId, |
|
|
|
updateConfigInfoById, |
|
|
|
} = require("../service/config.service"); |
|
|
|
const Response = require("../utils/response"); |
|
|
|
|
|
|
|
class ConfigController { |
|
|
|
async info(ctx, next) { |
|
|
|
const { house_id } = ctx.request.query; |
|
|
|
const res = await getConfigByHouseId(house_id); |
|
|
|
ctx.body = Response(0, "查询当前鸡场配置信息成功", res); |
|
|
|
} |
|
|
|
|
|
|
|
async updateInfo(ctx, next) { |
|
|
|
const { house_id, market_life_min } = ctx.request.body; |
|
|
|
const res = await updateConfigInfoById(house_id, market_life_min); |
|
|
|
ctx.body = Response(0, "更新鸡场配置信息成功", res); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
module.exports = new ConfigController(); |