//package com.inkasso.kafubao.system.user.controller;
//
//import com.inkasso.auth.interfaces.Permissions;
//import com.inkasso.auth.interfaces.PermissionAndCheck;
//import com.inkasso.adapter.page.PageResult;
//import com.inkasso.kafubao.system.user.model.dto.WxAccountDTO;
//import com.inkasso.kafubao.system.user.model.request.AddWxAccountRequest;
//import com.inkasso.kafubao.system.user.model.request.EditWxAccountRequest;
//import com.inkasso.kafubao.system.user.model.request.QueryWxAccountRequest;
//import com.inkasso.kafubao.system.user.service.WxAccountService;
//import com.inkasso.adapter.exception.ServiceException;
//import com.inkasso.adapter.response.ResponseData;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.PutMapping;
//import org.springframework.web.bind.annotation.DeleteMapping;
//import org.springframework.web.bind.annotation.GetMapping;
//import com.inkasso.adapter.exception.enums.KafubaoExceptionEnum;
//
//
//import java.util.List;
//
///**
// * @author 张超
// * @date  2023-08-17
// */
//@RestController
//@RequestMapping(path = "wxaccount")
//@Permissions(name="微信小程序账户",code = "wxaccountManage")
//public class WxAccountController {
//
//    @Autowired
//    private WxAccountService wxAccountService;
//
//
//
//    @PostMapping(path = "wxaccount")
//    @PermissionAndCheck(name="添加微信小程序账户",code="WxAccountController:add")
//    public ResponseData add(@Validated @RequestBody AddWxAccountRequest addWxAccountRequest) {
//
//        wxAccountService.addWxAccount(addWxAccountRequest);
//        return ResponseData.success();
//
//    }
//
//    @PutMapping(path = "wxaccount")
//    @PermissionAndCheck(name="更新微信小程序账户",code="WxAccountController:update")
//    public ResponseData edit(@Validated @RequestBody EditWxAccountRequest editWxAccountRequest) {
//        wxAccountService.editWxAccount(editWxAccountRequest);
//        return ResponseData.success();
//    }
//
//    @GetMapping(path = "wxaccount/{id}")
//    @PermissionAndCheck(name = "查询微信小程序账户详细信息", code="WxAccountController:detail")
//    public ResponseData getById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        WxAccountDTO wxAccountDTO = wxAccountService.getById(id);
//        return ResponseData.success(wxAccountDTO);
//
//    }
//
//
//    @DeleteMapping(path = "wxaccount/{id}")
//    @PermissionAndCheck(name = "删除微信小程序账户", code="WxAccountController:delete")
//    public ResponseData deleteById(@PathVariable("id") Long id){
//        if(id==null){
//            throw new ServiceException(400, KafubaoExceptionEnum.SYSTEM_DATE_ERROR);
//        }
//        wxAccountService.deleteWxAccount(id);
//        return ResponseData.success();
//    }
//}