package com.mmc.iuav.user.controller;

import com.mmc.iuav.group.Insert;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.vo.CompanyAuthVO;
import com.mmc.iuav.user.model.vo.CooperationTagVO;
import com.mmc.iuav.user.model.vo.UserApplyTagVO;
import com.mmc.iuav.user.service.CooperationService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author: zj
 * @Date: 2023/5/17 21:17
 */
@Api(tags = "合作加盟")
@RequestMapping("/cooperation/")
@RestController
public class CooperationController {
    @Autowired
    private CooperationService cooperationService;

    @ApiOperation(value = "加盟标签列表")
    @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class) })
    @GetMapping("listTag")
    public ResultBody listTag() {
        return cooperationService.listTag();
    }

    @ApiOperation(value = "申请加盟")
    @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) })
    @PostMapping("apply")
    public ResultBody apply(@Validated(value = {Insert.class})@RequestBody UserApplyTagVO userApplyTagVO){
        return cooperationService.apply(userApplyTagVO);
    }
}
