/*
 * @Author: error: git config user.name && git config user.email & please set dead value or install git
 * @Date: 2022-07-10 21:57:33
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2022-07-10 22:06:15
 * @FilePath: /gsd/controllers/apis_v1_dev.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "apis_v1_dev.h"

using namespace apis::v1;

// Add definition of your processing function here

void dev::postExpel(const HttpRequestPtr& req, std::function<void (const HttpResponsePtr &)> &&callback, std::string commandCode){
    if(Expel::getPtr()->getExpelSize() == 0){
        auto *pluginPtr=app().getPlugin<httpHelper>();
        callback(pluginPtr->makeWrongReply("设备列表为空"));
    }
    Expel::getPtr()->Controler(commandCode);
    HttpResultMsg<HttpNull, HttpNull> request;
    std::string json;
    request.code = "200";
    request.msg = "成功";
    request.ok = true;
    request.objectToJson(json);
    HttpResponsePtr resp;
    resp = HttpResponse::newHttpResponse();
    resp->setBody(json);
    callback(resp);
}