package com.github.wxiaoqi.security.admin.rest.admin;

import com.github.wxiaoqi.security.admin.biz.AppUserRelationBiz;
import com.github.wxiaoqi.security.admin.dto.UserRelationDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserRelation;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("relation/admin")
public class AdminUserRelationController extends BaseController<AppUserRelationBiz,AppUserRelation> {


    @RequestMapping(value = "/bind",method = RequestMethod.POST)
    @ApiModelProperty("后台绑定")
    public ObjectRestResponse bind(@RequestBody UserRelationDTO relationDTO){
        try {
        return baseBiz.adminBindRelation(relationDTO);
        } catch (Exception e) {
            e.printStackTrace();
            throw new BaseException(e);
        }
    }


}