| | |
| | | import com.moral.service.OrganizationService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | @RestController |
| | | @RequestMapping("organization") |
| | | public class OrganizationController { |
| | | @Resource |
| | | OrganizationService organizationService; |
| | | |
| | | @GetMapping("page-list") |
| | | public PageBean pageList(PageBean pageBean) { |
| | | return organizationService.queryByPageBean(pageBean); |
| | |
| | | ResultBean resultBean = new ResultBean(ResultBean.SUCCESS); |
| | | return resultBean; |
| | | } |
| | | |
| | | @GetMapping("list/{name}") |
| | | public ResultBean<List<Organization>> getOrganizationsByName(@PathVariable("name") String name) { |
| | | List<Organization> organizations = organizationService.getOrganizationsByName(name); |
| | | return new ResultBean<List<Organization>>(organizations); |
| | | } |
| | | |
| | | } |