|
|
@@ -1,20 +1,74 @@
|
|
|
package com.template.controller;
|
|
|
|
|
|
|
|
|
+import com.template.api.WelcomeOrgControllerAPI;
|
|
|
+import com.template.model.pojo.WelcomeOrg;
|
|
|
+import com.template.model.result.CommonResult;
|
|
|
+import com.template.model.vo.ListVo;
|
|
|
+import com.template.services.WelcomeOrgService;
|
|
|
+import com.template.services.WelcomeStudentService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 前端控制器
|
|
|
+ * 前端控制器
|
|
|
* </p>
|
|
|
*
|
|
|
* @author ceshi
|
|
|
* @since 2025-06-16
|
|
|
*/
|
|
|
@RestController
|
|
|
-public class WelcomeOrgController {
|
|
|
+public class WelcomeOrgController implements WelcomeOrgControllerAPI {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WelcomeOrgService welcomeOrgService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CommonResult getColleges() {
|
|
|
+ List<WelcomeOrg> colleges = welcomeOrgService.queryColleges();
|
|
|
+
|
|
|
+ List<ListVo> result = new ArrayList<>();
|
|
|
+ for (WelcomeOrg coll:colleges) {
|
|
|
+ ListVo data = new ListVo();
|
|
|
+ data.setId(coll.getId());
|
|
|
+ data.setName(coll.getName());
|
|
|
+ result.add(data);
|
|
|
+ }
|
|
|
+ return CommonResult.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CommonResult getMajors(Integer collegeId) {
|
|
|
+ List<WelcomeOrg> majors = welcomeOrgService.queryMajors(collegeId);
|
|
|
+
|
|
|
+ List<ListVo> result = new ArrayList<>();
|
|
|
+ for (WelcomeOrg maj:majors) {
|
|
|
+ ListVo data = new ListVo();
|
|
|
+ data.setId(maj.getId());
|
|
|
+ data.setName(maj.getName());
|
|
|
+ result.add(data);
|
|
|
+ }
|
|
|
+ return CommonResult.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CommonResult getClasss(Integer majorId) {
|
|
|
+ List<WelcomeOrg> classs = welcomeOrgService.queryClasss(majorId);
|
|
|
|
|
|
+ List<ListVo> result = new ArrayList<>();
|
|
|
+ for (WelcomeOrg maj:classs) {
|
|
|
+ ListVo data = new ListVo();
|
|
|
+ data.setId(maj.getId());
|
|
|
+ data.setName(maj.getName());
|
|
|
+ result.add(data);
|
|
|
+ }
|
|
|
+ return CommonResult.ok(result);
|
|
|
+ }
|
|
|
}
|
|
|
|