|
|
@@ -0,0 +1,82 @@
|
|
|
+package io.renren.modules.qyh.controller;
|
|
|
+
|
|
|
+import io.renren.common.utils.PageUtils;
|
|
|
+import io.renren.common.utils.R;
|
|
|
+import io.renren.common.validator.ValidatorUtils;
|
|
|
+import io.renren.modules.qyh.entity.ServiceCityEntity;
|
|
|
+import io.renren.modules.qyh.service.ServiceCityService;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 服务城市
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("qyh/serviceCity")
|
|
|
+public class ServiceCityController {
|
|
|
+ @Autowired
|
|
|
+ private ServiceCityService serviceCityService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 列表
|
|
|
+ */
|
|
|
+ @RequestMapping("/list")
|
|
|
+ @RequiresPermissions("qyh:serviceCity:list")
|
|
|
+ public R list(@RequestParam Map<String, Object> params){
|
|
|
+ PageUtils page = serviceCityService.queryPage(params);
|
|
|
+
|
|
|
+ return R.ok().put("page", page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 信息
|
|
|
+ */
|
|
|
+ @RequestMapping("/info/{id}")
|
|
|
+ @RequiresPermissions("qyh:serviceCity:info")
|
|
|
+ public R info(@PathVariable("id") Long id){
|
|
|
+ ServiceCityEntity serviceCityEntity = serviceCityService.getById(id);
|
|
|
+
|
|
|
+ return R.ok().put("serviceCityEntity", serviceCityEntity);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存
|
|
|
+ */
|
|
|
+ @RequestMapping("/save")
|
|
|
+ @RequiresPermissions("qyh:serviceCity:save")
|
|
|
+ public R save(@RequestBody ServiceCityEntity serviceCityEntity){
|
|
|
+ serviceCityService.saveEntity(serviceCityEntity);
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改
|
|
|
+ */
|
|
|
+ @RequestMapping("/update")
|
|
|
+ @RequiresPermissions("qyh:serviceCity:update")
|
|
|
+ public R update(@RequestBody ServiceCityEntity serviceCityEntity){
|
|
|
+ ValidatorUtils.validateEntity(serviceCityEntity);
|
|
|
+ serviceCityService.updateEntityById(serviceCityEntity);
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ */
|
|
|
+ @RequestMapping("/delete")
|
|
|
+ @RequiresPermissions("qyh:serviceCity:delete")
|
|
|
+ public R delete(@RequestBody Long[] ids){
|
|
|
+ serviceCityService.removeByIds(Arrays.asList(ids));
|
|
|
+
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|