| | |
| | | package com.moral.controller;
|
| | |
|
| | | import static com.moral.common.util.WebUtils.getParametersStartingWith;
|
| | |
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.web.bind.annotation.CrossOrigin;
|
| | | import org.springframework.web.bind.annotation.PostMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | |
|
| | | import com.moral.common.bean.PageBean;
|
| | | import com.moral.common.bean.ResultBean;
|
| | | import com.moral.entity.MachineActivate;
|
| | | import com.moral.service.MachineActivateService;
|
| | |
|
| | | @RestController
|
| | |
| | | @Resource
|
| | | private MachineActivateService machineActivateService;
|
| | |
|
| | | @PostMapping("machine")
|
| | | @GetMapping("machine")
|
| | | public ResultBean<Integer> activateMachine(Integer organizationId,String expireDate) {
|
| | | Integer code = machineActivateService.createMachineActivate(organizationId,expireDate);
|
| | | return new ResultBean<Integer>(code);
|
| | | }
|
| | |
|
| | | @GetMapping("list")
|
| | | public PageBean<MachineActivate> getMachineActivates(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | PageBean<MachineActivate> machineActivates = machineActivateService.getMachineActivates(parameters);
|
| | | return machineActivates;
|
| | | }
|
| | |
|
| | | }
|