|  | @@ -0,0 +1,70 @@
 | 
	
		
			
				|  |  | +package com.ym.mec.web.controller;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | +import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.Date;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.http.MediaType;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.entity.VipGroupCategory;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.VipGroupCategoryService;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.controller.BaseController;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +@Api(tags = "vip课类别")
 | 
	
		
			
				|  |  | +@RequestMapping("VipGroupCategory")
 | 
	
		
			
				|  |  | +@RestController
 | 
	
		
			
				|  |  | +public class VipGroupCategoryController extends BaseController {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private VipGroupCategoryService vipGroupCategoryService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@ApiOperation("单查询")
 | 
	
		
			
				|  |  | +	@GetMapping(value = "/query", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  | +	public Object query(int id) {
 | 
	
		
			
				|  |  | +		return succeed(vipGroupCategoryService.get(id));
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@ApiOperation("全查询")
 | 
	
		
			
				|  |  | +	@GetMapping(value = "/queryAll", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  | +	public Object queryAll() {
 | 
	
		
			
				|  |  | +		return succeed(vipGroupCategoryService.findAll(null));
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@ApiOperation("新增")
 | 
	
		
			
				|  |  | +	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  | +	public Object add(VipGroupCategory vipGroupCategory) {
 | 
	
		
			
				|  |  | +		Date date = new Date();
 | 
	
		
			
				|  |  | +		vipGroupCategory.setCreateTime(date);
 | 
	
		
			
				|  |  | +		vipGroupCategory.setUpdateTime(date);
 | 
	
		
			
				|  |  | +		vipGroupCategory.setDelFlag("0");
 | 
	
		
			
				|  |  | +		vipGroupCategoryService.insert(vipGroupCategory);
 | 
	
		
			
				|  |  | +		return succeed();
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@ApiOperation("修改")
 | 
	
		
			
				|  |  | +	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  | +	public Object update(VipGroupCategory vipGroupCategory) {
 | 
	
		
			
				|  |  | +		Date date = new Date();
 | 
	
		
			
				|  |  | +		vipGroupCategory.setUpdateTime(date);
 | 
	
		
			
				|  |  | +		vipGroupCategoryService.update(vipGroupCategory);
 | 
	
		
			
				|  |  | +		return succeed();
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	@ApiOperation("删除")
 | 
	
		
			
				|  |  | +	@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
 | 
	
		
			
				|  |  | +	public Object delete(int id) {
 | 
	
		
			
				|  |  | +		VipGroupCategory vipGroupCategory = vipGroupCategoryService.get(id);
 | 
	
		
			
				|  |  | +		Date date = new Date();
 | 
	
		
			
				|  |  | +		vipGroupCategory.setUpdateTime(date);
 | 
	
		
			
				|  |  | +		vipGroupCategory.setDelFlag("1");
 | 
	
		
			
				|  |  | +		vipGroupCategoryService.update(vipGroupCategory);
 | 
	
		
			
				|  |  | +		return succeed();
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 |