package com.sqx.modules.bl.commission.ywy.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
import com.sqx.modules.bl.commission.ywy.service.YwyApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@RequestMapping("/app/commission/ywy")
@Api(value = "分佣管理", tags = {"业务员管理app"})
public class AppYwyController {

    @Autowired
    private YwyApplyService service;

    @GetMapping("/apply")
    @ApiOperation("申请业务员")
    public Result apply(YwyApply ywyApply){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        ywyApply.setCreateTime(sdf.format(new Date()));
        service.add(ywyApply);
        return Result.success();
    }
}
