1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- package com.ym.mec.web.controller;
- import com.ym.mec.common.exception.BizException;
- import io.swagger.annotations.Api;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.ym.mec.biz.dal.dao.SysUserCashAccountDao;
- import com.ym.mec.biz.dal.dao.TeacherDao;
- import com.ym.mec.biz.dal.entity.SysUserCashAccount;
- import com.ym.mec.biz.dal.entity.Teacher;
- import com.ym.mec.biz.service.PracticeLessonApplyService;
- import com.ym.mec.common.controller.BaseController;
- import javax.swing.plaf.basic.BasicIconFactory;
- @RequestMapping("api")
- @Api(tags = "对外接口")
- @RestController
- public class APIController extends BaseController {
- @Autowired
- private SysUserCashAccountDao sysUserCashAccountDao;
-
- @Autowired
- private TeacherDao teacherDao;
- @Autowired
- private PracticeLessonApplyService practiceLessonApplyService;
- @GetMapping("/createCashAccount")
- public Boolean createCashAccount(Integer userId) {
- // 添加用户现金账户
- sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
- return true;
- }
- @GetMapping("/queryTeacherOrganId")
- public Integer queryTeacherOrganId(Integer userId) {
- Teacher teacher = teacherDao.get(userId);
- if (teacher != null) {
- return teacher.getTeacherOrganId();
- }
- return null;
- }
- @GetMapping("/practiceSum")
- public Object practiceSum() {
- return succeed(practiceLessonApplyService.practiceSum());
- }
- }
|