Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
engine-class-work
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuchengjiu
engine-class-work
Commits
007a8317
Commit
007a8317
authored
Jan 29, 2022
by
liu_cheng_jiu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
a77d30b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
6 deletions
+83
-6
ClassService.java
...a/cn/exploring/engine/server/db/service/ClassService.java
+3
-3
StudentPointService.java
...ploring/engine/server/db/service/StudentPointService.java
+26
-3
ClassController.java
...va/cn/exploring/engine/server/wx/web/ClassController.java
+29
-0
PointController.java
...va/cn/exploring/engine/server/wx/web/PointController.java
+25
-0
No files found.
server-db/src/main/java/cn/exploring/engine/server/db/service/ClassService.java
View file @
007a8317
...
...
@@ -45,10 +45,10 @@ public class ClassService {
* @param className
* @return
*/
public
Object
addClassInfo
(
String
className
)
{
public
String
addClassInfo
(
String
className
)
{
List
<
ClassInfo
>
classInfoList
=
selectClass
(
className
);
if
(
classInfoList
!=
null
&&
classInfoList
.
size
()
!=
0
)
{
return
"当前已存在该班级"
;
return
"
fail
当前已存在该班级"
;
}
ClassInfo
classInfo
=
new
ClassInfo
();
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
@@ -57,7 +57,7 @@ public class ClassService {
classInfo
.
setDeleted
(
false
);
classInfo
.
setClassName
(
className
);
classInfoMapper
.
insertSelective
(
classInfo
);
return
"添加班级成功"
;
return
"
OK
添加班级成功"
;
}
public
void
updateClassInfo
(
ClassInfo
classInfo
)
{
...
...
server-db/src/main/java/cn/exploring/engine/server/db/service/StudentPointService.java
View file @
007a8317
...
...
@@ -2,6 +2,7 @@ package cn.exploring.engine.server.db.service;
import
cn.exploring.engine.server.db.dao.StudentPointInfoMapper
;
import
cn.exploring.engine.server.db.domain.StudentPointInfo
;
import
cn.exploring.engine.server.db.domain.StudentPointInfoExample
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -14,12 +15,25 @@ public class StudentPointService {
@Resource
StudentPointInfoMapper
studentPointInfoMapper
;
// public List<StudentPointInfo> selectPointInfo() {
//
// }
/**
* id 检索
* @param idList
* @return
*/
public
List
<
StudentPointInfo
>
selectPointInfo
(
List
<
Integer
>
idList
)
{
StudentPointInfoExample
example
=
new
StudentPointInfoExample
();
StudentPointInfoExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andDeletedEqualTo
(
false
);
if
(
idList
!=
null
&&
idList
.
size
()
>
0
)
{
criteria
.
andIdIn
(
idList
);
}
return
studentPointInfoMapper
.
selectByExample
(
example
);
}
public
Object
addPoint
(
StudentPointInfo
studentPoint
)
{
LocalDateTime
now
=
LocalDateTime
.
now
();
studentPoint
.
setRecordTime
(
now
);
studentPoint
.
setUpdateTime
(
now
);
studentPoint
.
setAddTime
(
now
);
studentPoint
.
setDeleted
(
false
);
...
...
@@ -34,4 +48,13 @@ public class StudentPointService {
return
"update OK"
;
}
public
Object
batchDeleted
(
List
<
Integer
>
idList
)
{
List
<
StudentPointInfo
>
studentPointInfoList
=
selectPointInfo
(
idList
);
studentPointInfoList
.
forEach
(
x
->
{
x
.
setDeleted
(
null
);
updatePoint
(
x
);
});
return
"batch deleted OK"
;
}
}
server-wx-api/src/main/java/cn/exploring/engine/server/wx/web/ClassController.java
0 → 100644
View file @
007a8317
package
cn
.
exploring
.
engine
.
server
.
wx
.
web
;
import
cn.exploring.engine.server.core.util.ResponseUtil
;
import
cn.exploring.engine.server.db.domain.ClassInfo
;
import
cn.exploring.engine.server.db.service.ClassService
;
import
cn.exploring.engine.server.db.service.StudentPointService
;
import
cn.exploring.engine.server.wx.annotation.LoginUser
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
@RestController
@RequestMapping
(
"/wx/class"
)
@Validated
public
class
ClassController
{
@Resource
ClassService
classService
;
@GetMapping
(
"addClass"
)
public
Object
commitUserLessonRecord
(
@RequestParam
String
className
)
{
String
status
=
classService
.
addClassInfo
(
className
);
return
status
.
contains
(
"OK"
)
?
ResponseUtil
.
ok
(
status
)
:
ResponseUtil
.
fail
(
502
,
status
);
}
}
server-wx-api/src/main/java/cn/exploring/engine/server/wx/web/PointController.java
0 → 100644
View file @
007a8317
package
cn
.
exploring
.
engine
.
server
.
wx
.
web
;
import
cn.exploring.engine.server.core.util.ResponseUtil
;
import
cn.exploring.engine.server.db.service.ClassService
;
import
cn.exploring.engine.server.db.service.StudentPointService
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
@RestController
@RequestMapping
(
"/wx/point"
)
@Validated
public
class
PointController
{
@Resource
StudentPointService
pointService
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment