| | |
| | | import com.moral.common.bean.PageBean; |
| | | import com.moral.common.bean.ResultBean; |
| | | import com.moral.entity.Organization; |
| | | import com.moral.security.auth.JwtAuthenticationToken; |
| | | import com.moral.security.model.UserContext; |
| | | import com.moral.service.OrganizationService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | List<Organization> organizations = organizationService.getOrganizationsByName(name); |
| | | return new ResultBean<List<Organization>>(organizations); |
| | | } |
| | | |
| | | @GetMapping("get-my-org") |
| | | public ResultBean<Organization> getMyOrganization(JwtAuthenticationToken token){ |
| | | UserContext userContext = token.getPrincipal(); |
| | | Organization organization = organizationService.getOrganizationsById(userContext.getOrganizationId()); |
| | | return new ResultBean<>(organization); |
| | | } |
| | | } |