Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
Overview
Overview
Details
Activity
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
吴迪
gs1-office-web-sit
Commits
c6a9f1d4
Commit
c6a9f1d4
authored
Oct 12, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始代码提交
parent
a39fad8d
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
567 additions
and
2 deletions
+567
-2
NewsColumnController.java
...ffice/modules/manage/controller/NewsColumnController.java
+125
-0
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+90
-0
NewsColumnDao.java
...main/java/io/office/modules/manage/dao/NewsColumnDao.java
+17
-0
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+17
-0
NewsColumnEntity.java
...ava/io/office/modules/manage/entity/NewsColumnEntity.java
+36
-0
NewsEntity.java
...main/java/io/office/modules/manage/entity/NewsEntity.java
+124
-0
NewsColumnService.java
...a/io/office/modules/manage/service/NewsColumnService.java
+24
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+20
-0
NewsColumnServiceImpl.java
...ce/modules/manage/service/impl/NewsColumnServiceImpl.java
+30
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+30
-0
SysLoginController.java
.../io/office/modules/sys/controller/SysLoginController.java
+2
-2
NewsColumnDao.xml
src/main/resources/mapper/manage/NewsColumnDao.xml
+15
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+37
-0
No files found.
src/main/java/io/office/modules/manage/controller/NewsColumnController.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.office.modules.app.annotation.Login
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.office.modules.manage.entity.NewsColumnEntity
;
import
io.office.modules.manage.service.NewsColumnService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
@RestController
@RequestMapping
(
"/newscolumn"
)
public
class
NewsColumnController
{
@Autowired
private
NewsColumnService
newsColumnService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:newscolumn:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
newsColumnService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{columnid}"
)
// @RequiresPermissions("manage:newscolumn:info")
public
R
info
(
@PathVariable
(
"columnid"
)
Integer
columnid
){
NewsColumnEntity
newsColumn
=
newsColumnService
.
getById
(
columnid
);
return
R
.
ok
().
put
(
"newsColumn"
,
newsColumn
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:newscolumn:save")
public
R
save
(
@RequestBody
NewsColumnEntity
newsColumn
){
newsColumnService
.
save
(
newsColumn
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:newscolumn:update")
public
R
update
(
@RequestBody
NewsColumnEntity
newsColumn
){
newsColumnService
.
updateById
(
newsColumn
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:newscolumn:delete")
public
R
delete
(
@RequestBody
Integer
[]
columnids
){
newsColumnService
.
removeByIds
(
Arrays
.
asList
(
columnids
));
return
R
.
ok
();
}
/**
* 文章管理新增的时候获取栏目选项
*/
//@Login //标识必须登录状态下才能请求此接口
@RequestMapping
(
"/getNewsClassList"
)
public
R
getNewsClassList
(){
QueryWrapper
<
NewsColumnEntity
>
newsColumnEntityQueryWrapper
=
new
QueryWrapper
<>();
//之前前端固定写死的几个
List
list
=
new
ArrayList
();
list
.
add
(
5
);
list
.
add
(
6
);
list
.
add
(
7
);
list
.
add
(
8
);
list
.
add
(
9
);
list
.
add
(
29
);
list
.
add
(
32
);
list
.
add
(
33
);
list
.
add
(
38
);
list
.
add
(
42
);
newsColumnEntityQueryWrapper
.
in
(
"columnid"
,
list
);
List
<
NewsColumnEntity
>
newsColumnEntities
=
newsColumnService
.
list
(
newsColumnEntityQueryWrapper
);
return
R
.
ok
().
put
(
"data"
,
newsColumnEntities
);
}
}
src/main/java/io/office/modules/manage/controller/NewsController.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
controller
;
import
java.util.Arrays
;
import
java.util.Map
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.service.NewsService
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.R
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
@RestController
@RequestMapping
(
"/news"
)
public
class
NewsController
{
@Autowired
private
NewsService
newsService
;
/**
* 列表
*/
@RequestMapping
(
"/list"
)
// @RequiresPermissions("manage:news:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
newsService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
/**
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
// @RequiresPermissions("manage:news:info")
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
){
NewsEntity
news
=
newsService
.
getById
(
id
);
return
R
.
ok
().
put
(
"news"
,
news
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:news:save")
public
R
save
(
@RequestBody
NewsEntity
news
){
newsService
.
save
(
news
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:news:update")
public
R
update
(
@RequestBody
NewsEntity
news
){
newsService
.
updateById
(
news
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:news:delete")
public
R
delete
(
@RequestBody
Integer
[]
ids
){
newsService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
}
src/main/java/io/office/modules/manage/dao/NewsColumnDao.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.NewsColumnEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
@Mapper
public
interface
NewsColumnDao
extends
BaseMapper
<
NewsColumnEntity
>
{
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
dao
;
import
io.office.modules.manage.entity.NewsEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
@Mapper
public
interface
NewsDao
extends
BaseMapper
<
NewsEntity
>
{
}
src/main/java/io/office/modules/manage/entity/NewsColumnEntity.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
@Data
@TableName
(
"news_column"
)
public
class
NewsColumnEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
columnid
;
/**
* $column.comments
*/
private
String
columnname
;
/**
* $column.comments
*/
private
Integer
channelid
;
}
src/main/java/io/office/modules/manage/entity/NewsEntity.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
@Data
@TableName
(
"news"
)
public
class
NewsEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* $column.comments
*/
@TableId
private
Integer
id
;
/**
* $column.comments
*/
private
Integer
columnid
;
/**
* $column.comments
*/
private
String
title
;
/**
* $column.comments
*/
private
String
titleOld
;
/**
* $column.comments
*/
private
String
keyword
;
/**
* $column.comments
*/
private
String
brief
;
/**
* $column.comments
*/
private
Date
releasedate
;
/**
* $column.comments
*/
private
Date
updatedate
;
/**
* $column.comments
*/
private
String
author
;
/**
* $column.comments
*/
private
String
source
;
/**
* $column.comments
*/
private
Integer
levels
;
/**
* $column.comments
*/
private
String
directpath
;
/**
* $column.comments
*/
private
String
pic
;
/**
* $column.comments
*/
private
String
content
;
/**
* $column.comments
*/
private
Integer
hits
;
/**
* $column.comments
*/
private
String
editor
;
/**
* $column.comments
*/
private
String
lasteditor
;
/**
* $column.comments
*/
private
Integer
classid
;
/**
* $column.comments
*/
private
Date
publicdate
;
/**
* $column.comments
*/
private
Date
startdate
;
/**
* $column.comments
*/
private
String
ishead
;
/**
* $column.comments
*/
private
Integer
status
;
/**
* $column.comments
*/
private
String
auditor
;
/**
* $column.comments
*/
private
String
showtime
;
/**
* $column.comments
*/
private
Date
checkdate
;
}
src/main/java/io/office/modules/manage/service/NewsColumnService.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.NewsColumnEntity
;
import
java.util.Map
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
public
interface
NewsColumnService
extends
IService
<
NewsColumnEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
}
src/main/java/io/office/modules/manage/service/NewsService.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
io.office.common.utils.PageUtils
;
import
io.office.modules.manage.entity.NewsEntity
;
import
java.util.Map
;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-10-11 14:53:31
*/
public
interface
NewsService
extends
IService
<
NewsEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
}
src/main/java/io/office/modules/manage/service/impl/NewsColumnServiceImpl.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.NewsColumnDao
;
import
io.office.modules.manage.entity.NewsColumnEntity
;
import
io.office.modules.manage.service.NewsColumnService
;
@Service
(
"newsColumnService"
)
public
class
NewsColumnServiceImpl
extends
ServiceImpl
<
NewsColumnDao
,
NewsColumnEntity
>
implements
NewsColumnService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
NewsColumnEntity
>
page
=
this
.
page
(
new
Query
<
NewsColumnEntity
>().
getPage
(
params
),
new
QueryWrapper
<
NewsColumnEntity
>()
);
return
new
PageUtils
(
page
);
}
}
\ No newline at end of file
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
0 → 100644
View file @
c6a9f1d4
package
io
.
office
.
modules
.
manage
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.office.common.utils.PageUtils
;
import
io.office.common.utils.Query
;
import
io.office.modules.manage.dao.NewsDao
;
import
io.office.modules.manage.entity.NewsEntity
;
import
io.office.modules.manage.service.NewsService
;
@Service
(
"newsService"
)
public
class
NewsServiceImpl
extends
ServiceImpl
<
NewsDao
,
NewsEntity
>
implements
NewsService
{
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
NewsEntity
>
page
=
this
.
page
(
new
Query
<
NewsEntity
>().
getPage
(
params
),
new
QueryWrapper
<
NewsEntity
>()
);
return
new
PageUtils
(
page
);
}
}
\ No newline at end of file
src/main/java/io/office/modules/sys/controller/SysLoginController.java
View file @
c6a9f1d4
...
@@ -64,10 +64,10 @@ public class SysLoginController extends AbstractController {
...
@@ -64,10 +64,10 @@ public class SysLoginController extends AbstractController {
*/
*/
@PostMapping
(
"/sys/login"
)
@PostMapping
(
"/sys/login"
)
public
Map
<
String
,
Object
>
login
(
@RequestBody
SysLoginForm
form
)
throws
IOException
{
public
Map
<
String
,
Object
>
login
(
@RequestBody
SysLoginForm
form
)
throws
IOException
{
boolean
captcha
=
sysCaptchaService
.
validate
(
form
.
getUuid
(),
form
.
getCaptcha
());
/*
boolean captcha = sysCaptchaService.validate(form.getUuid(), form.getCaptcha());
if(!captcha){
if(!captcha){
return R.error("验证码不正确");
return R.error("验证码不正确");
}
}
*/
//用户信息
//用户信息
SysUserEntity
user
=
sysUserService
.
queryByUserName
(
form
.
getUsername
());
SysUserEntity
user
=
sysUserService
.
queryByUserName
(
form
.
getUsername
());
...
...
src/main/resources/mapper/manage/NewsColumnDao.xml
0 → 100644
View file @
c6a9f1d4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.office.modules.manage.dao.NewsColumnDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.NewsColumnEntity"
id=
"newsColumnMap"
>
<result
property=
"columnid"
column=
"columnid"
/>
<result
property=
"columnname"
column=
"columnname"
/>
<result
property=
"channelid"
column=
"channelID"
/>
</resultMap>
</mapper>
\ No newline at end of file
src/main/resources/mapper/manage/NewsDao.xml
0 → 100644
View file @
c6a9f1d4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.office.modules.manage.dao.NewsDao"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"io.office.modules.manage.entity.NewsEntity"
id=
"newsMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"columnid"
column=
"columnid"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"titleOld"
column=
"title_old"
/>
<result
property=
"keyword"
column=
"keyword"
/>
<result
property=
"brief"
column=
"brief"
/>
<result
property=
"releasedate"
column=
"releasedate"
/>
<result
property=
"updatedate"
column=
"updatedate"
/>
<result
property=
"author"
column=
"author"
/>
<result
property=
"source"
column=
"source"
/>
<result
property=
"levels"
column=
"levels"
/>
<result
property=
"directpath"
column=
"directpath"
/>
<result
property=
"pic"
column=
"pic"
/>
<result
property=
"content"
column=
"content"
/>
<result
property=
"hits"
column=
"hits"
/>
<result
property=
"editor"
column=
"editor"
/>
<result
property=
"lasteditor"
column=
"lasteditor"
/>
<result
property=
"classid"
column=
"classid"
/>
<result
property=
"publicdate"
column=
"publicdate"
/>
<result
property=
"startdate"
column=
"startdate"
/>
<result
property=
"ishead"
column=
"ishead"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"auditor"
column=
"auditor"
/>
<result
property=
"showtime"
column=
"showtime"
/>
<result
property=
"checkdate"
column=
"checkdate"
/>
</resultMap>
</mapper>
\ No newline at end of file
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