Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Thinkingcao
silence-boot
提交
c8f68bd4
silence-boot
项目概览
Thinkingcao
/
silence-boot
8 个月 前同步成功
通知
193
Star
63
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
silence-boot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c8f68bd4
编写于
10月 28, 2019
作者:
T
Thinkingcao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增微信粉丝信息
上级
0708f343
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
626 addition
and
0 deletion
+626
-0
pom.xml
pom.xml
+1
-0
silence-admin/pom.xml
silence-admin/pom.xml
+2
-0
silence-generator/src/main/java/com/silence/generator/controller/FansController.java
...java/com/silence/generator/controller/FansController.java
+124
-0
silence-generator/src/main/java/com/silence/generator/domain/Fans.java
...ator/src/main/java/com/silence/generator/domain/Fans.java
+182
-0
silence-generator/src/main/java/com/silence/generator/mapper/FansMapper.java
...rc/main/java/com/silence/generator/mapper/FansMapper.java
+63
-0
silence-generator/src/main/java/com/silence/generator/service/IFansService.java
...main/java/com/silence/generator/service/IFansService.java
+55
-0
silence-generator/src/main/java/com/silence/generator/service/impl/FansServiceImpl.java
...a/com/silence/generator/service/impl/FansServiceImpl.java
+84
-0
silence-generator/src/main/resources/mapper/system/FansMapper.xml
...generator/src/main/resources/mapper/system/FansMapper.xml
+115
-0
未找到文件。
pom.xml
浏览文件 @
c8f68bd4
...
...
@@ -203,6 +203,7 @@
<version>
${silence.version}
</version>
</dependency>
<!-- 微信模块-->
<dependency>
<groupId>
com.silence
</groupId>
<artifactId>
silence-weixin
</artifactId>
...
...
silence-admin/pom.xml
浏览文件 @
c8f68bd4
...
...
@@ -85,8 +85,10 @@
<artifactId>
lombok
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
...
...
silence-generator/src/main/java/com/silence/generator/controller/FansController.java
0 → 100644
浏览文件 @
c8f68bd4
package
com.silence.generator.controller
;
import
com.silence.common.annotation.Log
;
import
com.silence.common.core.controller.BaseController
;
import
com.silence.common.core.domain.AjaxResult
;
import
com.silence.common.core.page.TableDataInfo
;
import
com.silence.common.enums.BusinessType
;
import
com.silence.common.utils.poi.ExcelUtil
;
import
com.silence.generator.domain.Fans
;
import
com.silence.generator.service.IFansService
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 粉丝 信息操作处理
*
* @author silence
* @date 2019-09-18
*/
@Controller
@RequestMapping
(
"/system/fans"
)
public
class
FansController
extends
BaseController
{
private
String
prefix
=
"system/fans"
;
@Autowired
private
IFansService
fansService
;
@RequiresPermissions
(
"system:fans:view"
)
@GetMapping
()
public
String
fans
()
{
return
prefix
+
"/fans"
;
}
/**
* 查询粉丝列表
*/
@RequiresPermissions
(
"system:fans:list"
)
@PostMapping
(
"/list"
)
@ResponseBody
public
TableDataInfo
list
(
Fans
fans
)
{
startPage
();
List
<
Fans
>
list
=
fansService
.
selectFansList
(
fans
);
return
getDataTable
(
list
);
}
/**
* 导出粉丝列表
*/
@RequiresPermissions
(
"system:fans:export"
)
@PostMapping
(
"/export"
)
@ResponseBody
public
AjaxResult
export
(
Fans
fans
)
{
List
<
Fans
>
list
=
fansService
.
selectFansList
(
fans
);
ExcelUtil
<
Fans
>
util
=
new
ExcelUtil
<
Fans
>(
Fans
.
class
);
return
util
.
exportExcel
(
list
,
"fans"
);
}
/**
* 新增粉丝
*/
@GetMapping
(
"/add"
)
public
String
add
()
{
return
prefix
+
"/add"
;
}
/**
* 新增保存粉丝
*/
@RequiresPermissions
(
"system:fans:add"
)
@Log
(
title
=
"粉丝"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"/add"
)
@ResponseBody
public
AjaxResult
addSave
(
Fans
fans
)
{
return
toAjax
(
fansService
.
insertFans
(
fans
));
}
/**
* 修改粉丝
*/
@GetMapping
(
"/edit/{id}"
)
public
String
edit
(
@PathVariable
(
"id"
)
String
id
,
ModelMap
mmap
)
{
Fans
fans
=
fansService
.
selectFansById
(
id
);
mmap
.
put
(
"fans"
,
fans
);
return
prefix
+
"/edit"
;
}
/**
* 修改保存粉丝
*/
@RequiresPermissions
(
"system:fans:edit"
)
@Log
(
title
=
"粉丝"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
"/edit"
)
@ResponseBody
public
AjaxResult
editSave
(
Fans
fans
)
{
return
toAjax
(
fansService
.
updateFans
(
fans
));
}
/**
* 删除粉丝
*/
@RequiresPermissions
(
"system:fans:remove"
)
@Log
(
title
=
"粉丝"
,
businessType
=
BusinessType
.
DELETE
)
@PostMapping
(
"/remove"
)
@ResponseBody
public
AjaxResult
remove
(
String
ids
)
{
return
toAjax
(
fansService
.
deleteFansByIds
(
ids
));
}
}
silence-generator/src/main/java/com/silence/generator/domain/Fans.java
0 → 100644
浏览文件 @
c8f68bd4
package
com.silence.generator.domain
;
import
com.silence.common.core.domain.BaseEntity
;
import
org.apache.commons.lang.builder.ToStringBuilder
;
import
org.apache.commons.lang.builder.ToStringStyle
;
import
java.util.Date
;
/**
* 粉丝表 fans
*
* @author silence
* @date 2019-09-18
*/
public
class
Fans
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/** ID */
private
String
id
;
/** OPENID */
private
String
openId
;
/** */
private
String
nickName
;
/** 性别 */
private
String
sex
;
/** 国家 */
private
String
country
;
/** 省份 */
private
String
province
;
/** 城市 */
private
String
city
;
/** 头像 */
private
String
headimgurl
;
/** 联合ID */
private
String
unionid
;
/** 真实姓名 */
private
String
realName
;
/** 手机号 */
private
String
phone
;
/** 是否关注(0:未关注,1:已关注) */
private
String
isSubscribe
;
/** 关注时间 */
private
Date
subscribe
;
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getId
()
{
return
id
;
}
public
void
setOpenId
(
String
openId
)
{
this
.
openId
=
openId
;
}
public
String
getOpenId
()
{
return
openId
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setSex
(
String
sex
)
{
this
.
sex
=
sex
;
}
public
String
getSex
()
{
return
sex
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getCountry
()
{
return
country
;
}
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
public
String
getProvince
()
{
return
province
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setHeadimgurl
(
String
headimgurl
)
{
this
.
headimgurl
=
headimgurl
;
}
public
String
getHeadimgurl
()
{
return
headimgurl
;
}
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getUnionid
()
{
return
unionid
;
}
public
void
setRealName
(
String
realName
)
{
this
.
realName
=
realName
;
}
public
String
getRealName
()
{
return
realName
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setIsSubscribe
(
String
isSubscribe
)
{
this
.
isSubscribe
=
isSubscribe
;
}
public
String
getIsSubscribe
()
{
return
isSubscribe
;
}
public
void
setSubscribe
(
Date
subscribe
)
{
this
.
subscribe
=
subscribe
;
}
public
Date
getSubscribe
()
{
return
subscribe
;
}
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"openId"
,
getOpenId
())
.
append
(
"nickName"
,
getNickName
())
.
append
(
"sex"
,
getSex
())
.
append
(
"country"
,
getCountry
())
.
append
(
"province"
,
getProvince
())
.
append
(
"city"
,
getCity
())
.
append
(
"headimgurl"
,
getHeadimgurl
())
.
append
(
"unionid"
,
getUnionid
())
.
append
(
"realName"
,
getRealName
())
.
append
(
"phone"
,
getPhone
())
.
append
(
"isSubscribe"
,
getIsSubscribe
())
.
append
(
"subscribe"
,
getSubscribe
())
.
toString
();
}
}
silence-generator/src/main/java/com/silence/generator/mapper/FansMapper.java
0 → 100644
浏览文件 @
c8f68bd4
package
com.silence.generator.mapper
;
import
com.silence.generator.domain.Fans
;
import
java.util.List
;
/**
* 粉丝 数据层
*
* @author silence
* @date 2019-09-18
*/
public
interface
FansMapper
{
/**
* 查询粉丝信息
*
* @param id 粉丝ID
* @return 粉丝信息
*/
public
Fans
selectFansById
(
String
id
);
/**
* 查询粉丝列表
*
* @param fans 粉丝信息
* @return 粉丝集合
*/
public
List
<
Fans
>
selectFansList
(
Fans
fans
);
/**
* 新增粉丝
*
* @param fans 粉丝信息
* @return 结果
*/
public
int
insertFans
(
Fans
fans
);
/**
* 修改粉丝
*
* @param fans 粉丝信息
* @return 结果
*/
public
int
updateFans
(
Fans
fans
);
/**
* 删除粉丝
*
* @param id 粉丝ID
* @return 结果
*/
public
int
deleteFansById
(
String
id
);
/**
* 批量删除粉丝
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public
int
deleteFansByIds
(
String
[]
ids
);
}
\ No newline at end of file
silence-generator/src/main/java/com/silence/generator/service/IFansService.java
0 → 100644
浏览文件 @
c8f68bd4
package
com.silence.generator.service
;
import
com.silence.generator.domain.Fans
;
import
java.util.List
;
/**
* 粉丝 服务层
*
* @author silence
* @date 2019-09-18
*/
public
interface
IFansService
{
/**
* 查询粉丝信息
*
* @param id 粉丝ID
* @return 粉丝信息
*/
public
Fans
selectFansById
(
String
id
);
/**
* 查询粉丝列表
*
* @param fans 粉丝信息
* @return 粉丝集合
*/
public
List
<
Fans
>
selectFansList
(
Fans
fans
);
/**
* 新增粉丝
*
* @param fans 粉丝信息
* @return 结果
*/
public
int
insertFans
(
Fans
fans
);
/**
* 修改粉丝
*
* @param fans 粉丝信息
* @return 结果
*/
public
int
updateFans
(
Fans
fans
);
/**
* 删除粉丝信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public
int
deleteFansByIds
(
String
ids
);
}
silence-generator/src/main/java/com/silence/generator/service/impl/FansServiceImpl.java
0 → 100644
浏览文件 @
c8f68bd4
package
com.silence.generator.service.impl
;
import
com.silence.common.core.text.Convert
;
import
com.silence.generator.domain.Fans
;
import
com.silence.generator.mapper.FansMapper
;
import
com.silence.generator.service.IFansService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 粉丝 服务层实现
*
* @author silence
* @date 2019-09-18
*/
@Service
public
class
FansServiceImpl
implements
IFansService
{
@Autowired
private
FansMapper
fansMapper
;
/**
* 查询粉丝信息
*
* @param id 粉丝ID
* @return 粉丝信息
*/
@Override
public
Fans
selectFansById
(
String
id
)
{
return
fansMapper
.
selectFansById
(
id
);
}
/**
* 查询粉丝列表
*
* @param fans 粉丝信息
* @return 粉丝集合
*/
@Override
public
List
<
Fans
>
selectFansList
(
Fans
fans
)
{
return
fansMapper
.
selectFansList
(
fans
);
}
/**
* 新增粉丝
*
* @param fans 粉丝信息
* @return 结果
*/
@Override
public
int
insertFans
(
Fans
fans
)
{
return
fansMapper
.
insertFans
(
fans
);
}
/**
* 修改粉丝
*
* @param fans 粉丝信息
* @return 结果
*/
@Override
public
int
updateFans
(
Fans
fans
)
{
return
fansMapper
.
updateFans
(
fans
);
}
/**
* 删除粉丝对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public
int
deleteFansByIds
(
String
ids
)
{
return
fansMapper
.
deleteFansByIds
(
Convert
.
toStrArray
(
ids
));
}
}
silence-generator/src/main/resources/mapper/system/FansMapper.xml
0 → 100644
浏览文件 @
c8f68bd4
<?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=
"com.silence.generator.mapper.FansMapper"
>
<resultMap
type=
"Fans"
id=
"FansResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"openId"
column=
"open_id"
/>
<result
property=
"nickName"
column=
"nick_name"
/>
<result
property=
"sex"
column=
"sex"
/>
<result
property=
"country"
column=
"country"
/>
<result
property=
"province"
column=
"province"
/>
<result
property=
"city"
column=
"city"
/>
<result
property=
"headimgurl"
column=
"headimgurl"
/>
<result
property=
"unionid"
column=
"unionid"
/>
<result
property=
"realName"
column=
"real_name"
/>
<result
property=
"phone"
column=
"phone"
/>
<result
property=
"isSubscribe"
column=
"is_subscribe"
/>
<result
property=
"subscribe"
column=
"subscribe"
/>
</resultMap>
<sql
id=
"selectFansVo"
>
select id, open_id, nick_name, sex, country, province, city, headimgurl, unionid, real_name, phone, is_subscribe, subscribe from fans
</sql>
<select
id=
"selectFansList"
parameterType=
"Fans"
resultMap=
"FansResult"
>
<include
refid=
"selectFansVo"
/>
<where>
<if
test=
"id != null and id != '' "
>
and id = #{id}
</if>
<if
test=
"openId != null and openId != '' "
>
and open_id = #{openId}
</if>
<if
test=
"nickName != null and nickName != '' "
>
and nick_name = #{nickName}
</if>
<if
test=
"sex != null and sex != '' "
>
and sex = #{sex}
</if>
<if
test=
"country != null and country != '' "
>
and country = #{country}
</if>
<if
test=
"province != null and province != '' "
>
and province = #{province}
</if>
<if
test=
"city != null and city != '' "
>
and city = #{city}
</if>
<if
test=
"headimgurl != null and headimgurl != '' "
>
and headimgurl = #{headimgurl}
</if>
<if
test=
"unionid != null and unionid != '' "
>
and unionid = #{unionid}
</if>
<if
test=
"realName != null and realName != '' "
>
and real_name = #{realName}
</if>
<if
test=
"phone != null and phone != '' "
>
and phone = #{phone}
</if>
<if
test=
"isSubscribe != null and isSubscribe != '' "
>
and is_subscribe = #{isSubscribe}
</if>
<if
test=
"subscribe != null "
>
and subscribe = #{subscribe}
</if>
</where>
</select>
<select
id=
"selectFansById"
parameterType=
"String"
resultMap=
"FansResult"
>
<include
refid=
"selectFansVo"
/>
where id = #{id}
</select>
<insert
id=
"insertFans"
parameterType=
"Fans"
>
insert into fans
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null and id != '' "
>
id,
</if>
<if
test=
"openId != null and openId != '' "
>
open_id,
</if>
<if
test=
"nickName != null and nickName != '' "
>
nick_name,
</if>
<if
test=
"sex != null and sex != '' "
>
sex,
</if>
<if
test=
"country != null and country != '' "
>
country,
</if>
<if
test=
"province != null and province != '' "
>
province,
</if>
<if
test=
"city != null and city != '' "
>
city,
</if>
<if
test=
"headimgurl != null and headimgurl != '' "
>
headimgurl,
</if>
<if
test=
"unionid != null and unionid != '' "
>
unionid,
</if>
<if
test=
"realName != null and realName != '' "
>
real_name,
</if>
<if
test=
"phone != null and phone != '' "
>
phone,
</if>
<if
test=
"isSubscribe != null and isSubscribe != '' "
>
is_subscribe,
</if>
<if
test=
"subscribe != null "
>
subscribe,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null and id != '' "
>
#{id},
</if>
<if
test=
"openId != null and openId != '' "
>
#{openId},
</if>
<if
test=
"nickName != null and nickName != '' "
>
#{nickName},
</if>
<if
test=
"sex != null and sex != '' "
>
#{sex},
</if>
<if
test=
"country != null and country != '' "
>
#{country},
</if>
<if
test=
"province != null and province != '' "
>
#{province},
</if>
<if
test=
"city != null and city != '' "
>
#{city},
</if>
<if
test=
"headimgurl != null and headimgurl != '' "
>
#{headimgurl},
</if>
<if
test=
"unionid != null and unionid != '' "
>
#{unionid},
</if>
<if
test=
"realName != null and realName != '' "
>
#{realName},
</if>
<if
test=
"phone != null and phone != '' "
>
#{phone},
</if>
<if
test=
"isSubscribe != null and isSubscribe != '' "
>
#{isSubscribe},
</if>
<if
test=
"subscribe != null "
>
#{subscribe},
</if>
</trim>
</insert>
<update
id=
"updateFans"
parameterType=
"Fans"
>
update fans
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"openId != null and openId != '' "
>
open_id = #{openId},
</if>
<if
test=
"nickName != null and nickName != '' "
>
nick_name = #{nickName},
</if>
<if
test=
"sex != null and sex != '' "
>
sex = #{sex},
</if>
<if
test=
"country != null and country != '' "
>
country = #{country},
</if>
<if
test=
"province != null and province != '' "
>
province = #{province},
</if>
<if
test=
"city != null and city != '' "
>
city = #{city},
</if>
<if
test=
"headimgurl != null and headimgurl != '' "
>
headimgurl = #{headimgurl},
</if>
<if
test=
"unionid != null and unionid != '' "
>
unionid = #{unionid},
</if>
<if
test=
"realName != null and realName != '' "
>
real_name = #{realName},
</if>
<if
test=
"phone != null and phone != '' "
>
phone = #{phone},
</if>
<if
test=
"isSubscribe != null and isSubscribe != '' "
>
is_subscribe = #{isSubscribe},
</if>
<if
test=
"subscribe != null "
>
subscribe = #{subscribe},
</if>
</trim>
where id = #{id}
</update>
<delete
id=
"deleteFansById"
parameterType=
"String"
>
delete from fans where id = #{id}
</delete>
<delete
id=
"deleteFansByIds"
parameterType=
"String"
>
delete from fans where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录