| package com.dsh.account.controller; | 
|   | 
| import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
| import com.dsh.account.entity.TAppUser; | 
| import com.dsh.account.entity.TCityManager; | 
| import com.dsh.account.feignclient.model.CityListQuery; | 
| import com.dsh.account.model.AddAppUserVo; | 
| import com.dsh.account.model.JoinPlayPaiVo; | 
| import com.dsh.account.model.LoginSMSCodeVo; | 
| import com.dsh.account.model.LoginWeChatVo; | 
| import com.dsh.account.service.CityService; | 
| import com.dsh.account.service.IVipPaymentService; | 
| import com.dsh.account.service.TAppUserService; | 
| import com.dsh.account.util.PayMoneyUtil; | 
| import com.dsh.account.util.ResultUtil; | 
| import com.dsh.account.util.TokenUtil; | 
| import com.dsh.account.util.ToolUtil; | 
| import io.swagger.annotations.ApiImplicitParam; | 
| import io.swagger.annotations.ApiImplicitParams; | 
| import io.swagger.annotations.ApiOperation; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| import javax.servlet.http.HttpServletRequest; | 
| import javax.servlet.http.HttpServletResponse; | 
| import java.io.PrintWriter; | 
| import java.util.Map; | 
|   | 
| /** | 
|  * @author zhibing.pu | 
|  * @date 2023/6/14 15:30 | 
|  */ | 
| @RestController | 
| @RequestMapping("") | 
| public class CityController { | 
|   | 
|     @Autowired | 
|     private CityService cityService; | 
|   | 
|   | 
|     @PostMapping("/base/city/list") | 
|     public Page<TCityManager> list(@RequestBody CityListQuery listQuery) { | 
|         try { | 
|             Page<TCityManager> page = new Page<>(listQuery.getOffset(), listQuery.getLimit()); | 
|             LambdaQueryWrapper<TCityManager> tCityManagerLambdaQueryWrapper = new LambdaQueryWrapper<>(); | 
|             tCityManagerLambdaQueryWrapper.ne(TCityManager::getState, 3); | 
|             if (ToolUtil.isNotEmpty(listQuery.getProvinceCode())) { | 
|                 tCityManagerLambdaQueryWrapper.eq(TCityManager::getProvinceCode, listQuery.getProvinceCode()); | 
|             } | 
|             if (ToolUtil.isNotEmpty(listQuery.getCityCode())) { | 
|                 tCityManagerLambdaQueryWrapper.eq(TCityManager::getCityCode, listQuery.getCityCode()); | 
|             } | 
|             if (ToolUtil.isNotEmpty(listQuery.getName())) { | 
|                 tCityManagerLambdaQueryWrapper.like(TCityManager::getName, listQuery.getName()); | 
|             } | 
|             if (ToolUtil.isNotEmpty(listQuery.getPhone())) { | 
|                 tCityManagerLambdaQueryWrapper.like(TCityManager::getPhone, listQuery.getPhone()); | 
|             } | 
|             Page<TCityManager> page1 = cityService.page(page, tCityManagerLambdaQueryWrapper); | 
|             return page1; | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|             return null; | 
|         } | 
|     } | 
|   | 
|   | 
|     @PostMapping("/base/city/add") | 
|     public Integer add(@RequestBody TCityManager manager) { | 
|         try { | 
|             cityService.save(manager); | 
|             return manager.getId(); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|             return null; | 
|         } | 
|     } | 
|   | 
|   | 
|     @PostMapping("/base/city/getById") | 
|     public TCityManager getById(@RequestBody Integer id) { | 
|         try { | 
|             return cityService.getById(id); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|             return null; | 
|         } | 
|     } | 
|   | 
|   | 
|     @PostMapping("/base/city/update") | 
|     public void update(@RequestBody TCityManager manager) { | 
|         try { | 
|             cityService.updateById(manager); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|         } | 
|     } | 
|   | 
|   | 
|     @PostMapping("/base/city/freeze") | 
|     public void freeze(@RequestBody Integer id) { | 
|         try { | 
|             TCityManager byId = cityService.getById(id); | 
|             byId.setState(2); | 
|             cityService.updateById(byId); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|         } | 
|     } | 
|   | 
|     @PostMapping("/base/city/unfreeze") | 
|     public void unfreeze(@RequestBody Integer id) { | 
|         try { | 
|             TCityManager byId = cityService.getById(id); | 
|             byId.setState(1); | 
|             cityService.updateById(byId); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|         } | 
|     } | 
| } |