APIController.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.ym.mec.web.controller;
  2. import com.ym.mec.common.exception.BizException;
  3. import io.swagger.annotations.Api;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
  9. import com.ym.mec.biz.dal.dao.TeacherDao;
  10. import com.ym.mec.biz.dal.entity.SysUserCashAccount;
  11. import com.ym.mec.biz.dal.entity.Teacher;
  12. import com.ym.mec.biz.service.PracticeLessonApplyService;
  13. import com.ym.mec.common.controller.BaseController;
  14. import javax.swing.plaf.basic.BasicIconFactory;
  15. @RequestMapping("api")
  16. @Api(tags = "对外接口")
  17. @RestController
  18. public class APIController extends BaseController {
  19. @Autowired
  20. private SysUserCashAccountDao sysUserCashAccountDao;
  21. @Autowired
  22. private TeacherDao teacherDao;
  23. @Autowired
  24. private PracticeLessonApplyService practiceLessonApplyService;
  25. @GetMapping("/createCashAccount")
  26. public Boolean createCashAccount(Integer userId) {
  27. // 添加用户现金账户
  28. sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
  29. return true;
  30. }
  31. @GetMapping("/queryTeacherOrganId")
  32. public Integer queryTeacherOrganId(Integer userId) {
  33. Teacher teacher = teacherDao.get(userId);
  34. if (teacher != null) {
  35. return teacher.getTeacherOrganId();
  36. }
  37. return null;
  38. }
  39. @GetMapping("/practiceSum")
  40. public Object practiceSum() {
  41. return succeed(practiceLessonApplyService.practiceSum());
  42. }
  43. }