Compare commits
1 Commits
6572f388f6
...
feature/2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42b046c5df |
@@ -1,5 +0,0 @@
|
|||||||
package kr.co.jinwoosi.clfd.framework.chat;
|
|
||||||
|
|
||||||
public interface ChatMapper {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package kr.co.jinwoosi.clfd.framework.chat.model;
|
|
||||||
|
|
||||||
import kr.co.jinwoosi.clfd.framework.base.model.BaseModel;
|
|
||||||
|
|
||||||
public class Chat extends BaseModel {
|
|
||||||
private
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package kr.co.jinwoosi.clfd.framework.chat.service.impl;
|
|
||||||
|
|
||||||
import kr.co.jinwoosi.clfd.framework.base.service.BaseService;
|
|
||||||
import kr.co.jinwoosi.clfd.framework.base.service.impl.BaseServiceImpl;
|
|
||||||
import kr.co.jinwoosi.clfd.framework.chat.ChatMapper;
|
|
||||||
import kr.co.jinwoosi.clfd.framework.chat.model.PgmSearch;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
@Service(value="pgmService")
|
|
||||||
public class ChatServiceImpl extends BaseServiceImpl<Chat, PgmSearch, ChatMapper> implements BaseService<Chat, PgmSearch> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Resource (name="pgmMapper")
|
|
||||||
protected void setMapper (ChatMapper mapper) {
|
|
||||||
super.setMapper (mapper);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
package kr.co.jinwoosi.clfd.framework.chat.web;
|
|
||||||
|
|
||||||
import kr.co.jinwoosi.clfd.framework.base.web.BaseController;
|
|
||||||
import kr.co.jinwoosi.clfd.framework.pgm.model.PgmSearch;
|
|
||||||
import kr.co.jinwoosi.clfd.framework.menu.service.MenuService;
|
|
||||||
import kr.co.jinwoosi.clfd.framework.pgm.service.PgmService;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
public class ChatController extends BaseController {
|
|
||||||
|
|
||||||
@Resource (name="menuService")
|
|
||||||
private MenuService menuService;
|
|
||||||
|
|
||||||
@Resource (name="pgmService")
|
|
||||||
private PgmService pgmService;
|
|
||||||
|
|
||||||
@RequestMapping (value="/system/chat/list.mng", method=RequestMethod.GET)
|
|
||||||
public String list(Model model) {
|
|
||||||
return "system/chat/list";
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping (value="/system/pgm/list.json", method=RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String, Object> list(HttpServletRequest request, PgmSearch pgmSearch) {
|
|
||||||
Map<String, Object> result = new HashMap<String, Object>();
|
|
||||||
try {
|
|
||||||
String sort = request.getParameter("columns[" + request.getParameter("order[0][column]") + "][name]");
|
|
||||||
String sortOder = request.getParameter("order[0][dir]");
|
|
||||||
pgmSearch.setSort(sort);
|
|
||||||
pgmSearch.setSortOrd(sortOder);
|
|
||||||
pgmSearch.setPagingYn(true);
|
|
||||||
|
|
||||||
int totalCount = pgmService.count(pgmSearch);
|
|
||||||
result.put("recordsTotal", totalCount);
|
|
||||||
result.put("recordsFiltered", totalCount);
|
|
||||||
|
|
||||||
result.put("data", pgmService.selectList(pgmSearch));
|
|
||||||
|
|
||||||
result.put("result", "success");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
result.put("result", "fail");
|
|
||||||
result.put("message", e.getMessage());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping (value="/system/pgm/view.json", method=RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String, Object> detail(HttpServletRequest request, PgmSearch pgmSearch) {
|
|
||||||
Map<String, Object> result = new HashMap<String, Object>();
|
|
||||||
try {
|
|
||||||
result.put("data", pgmService.select(pgmSearch));
|
|
||||||
result.put("result", "success");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
result.put("result", "fail");
|
|
||||||
result.put("message", e.getMessage());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping (value="/system/pgm/insert.json", method=RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String, Object> insert(HttpServletRequest request, Chat pgm) {
|
|
||||||
Map<String, Object> result = new HashMap<String, Object>();
|
|
||||||
try {
|
|
||||||
pgm.setRegId(getUserId());
|
|
||||||
pgmService.insert(pgm);
|
|
||||||
|
|
||||||
menuService.initRoleMenuList();;
|
|
||||||
result.put("result", "success");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
result.put("result", "fail");
|
|
||||||
result.put("message", e.getMessage());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping (value="/system/pgm/update.json", method=RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String, Object> update(HttpServletRequest request, Chat pgm) {
|
|
||||||
Map<String, Object> result = new HashMap<String, Object>();
|
|
||||||
try {
|
|
||||||
pgm.setUpdId(getUserId());
|
|
||||||
pgmService.update(pgm);
|
|
||||||
|
|
||||||
menuService.initRoleMenuList();
|
|
||||||
result.put("result", "success");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
result.put("result", "fail");
|
|
||||||
result.put("message", e.getMessage());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping (value="/system/pgm/delete.json", method=RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String, Object> delete(HttpServletRequest request, Chat pgm) {
|
|
||||||
Map<String, Object> result = new HashMap<String, Object>();
|
|
||||||
try {
|
|
||||||
pgm.setDelId(getUserId());
|
|
||||||
pgmService.delete(pgm);
|
|
||||||
|
|
||||||
menuService.initRoleMenuList();
|
|
||||||
result.put("result", "success");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
result.put("result", "fail");
|
|
||||||
result.put("message", e.getMessage());
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
<?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="">
|
|
||||||
|
|
||||||
<select id="selectList" parameterType="" resultType="">
|
|
||||||
SELECT CHAT_ID, USER_ID, ROOM_ID, CHAT_CONT, UN_USER, REG_DAY, DEL_DAY, REC_ST FROM CT_MSG
|
|
||||||
WEHRE CHAT_ID = #{chatId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="doInsert">
|
|
||||||
insert into CT_MSG(CHAT_ID, USER_ID, ROOM_ID, CHAT_CONT, UN_USER, REG_DT, DEL_DAY, REC_ST)
|
|
||||||
values(#{chatId}, #{userId}, #{roomId}, #{chatCont}, #{unUser}, #{regDt}, #{delDay}, #{recSt})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="doUpdate">
|
|
||||||
update CT_MSG
|
|
||||||
set
|
|
||||||
CHAT_ID = #{chatId}, <!--채팅ID-->
|
|
||||||
USER_ID = #{userId}, <!--유저ID-->
|
|
||||||
ROOM_ID = #{roomId}, <!--채팅방ID-->
|
|
||||||
CHAT_CONT = #{chatCont}, <!--채닝내용-->
|
|
||||||
UN_USER = #{unUser}, <!--미확인사용자수-->
|
|
||||||
REG_DT = #{regDt}, <!--등록일시-->
|
|
||||||
DEL_DAY = #{delDay}, <!--삭제일시-->
|
|
||||||
REC_ST = #{recSt} <!--레코드상태-->
|
|
||||||
where CHAT_ID = #{chatId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="doDelete">
|
|
||||||
delete from CT_MSG
|
|
||||||
where CHAT_ID = #{chatId}
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="login-text__find">
|
<div class="login-text__find">
|
||||||
<a href="/clfd/user/findId.do">
|
<a href="/clfd/user/findId.do">
|
||||||
<div>아이디를 잊으셨나요?</div>
|
<div>아이디를 잊으셨나요??</div>
|
||||||
</a>
|
</a>
|
||||||
<a href="/clfd/user/findPassword.do">
|
<a href="/clfd/user/findPassword.do">
|
||||||
<div>비밀번호를 잊으셨나요?</div>
|
<div>비밀번호를 잊으셨나요??</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,185 +0,0 @@
|
|||||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
||||||
<%@ include file="/WEB-INF/view/include/tags.jspf"%>
|
|
||||||
|
|
||||||
<section class="content-header">
|
|
||||||
<tg:menuInfoTag />
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-4">
|
|
||||||
<div class="box box-success">
|
|
||||||
<div class="box-header">
|
|
||||||
<h3 class="box-title"><i class='material-icons' style='font-size:16px;'>play_arrow</i> 사용자목록</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-9 col-xs-12" style="margin-bottom: 10px;">
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-addon">사용자검색</span>
|
|
||||||
<input type="text" id="pgmNmLike" class="form-control" placeholder="사용자검색" maxlength="50">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="btn btn-outline-primary" id="chatBtn">대화하기</button>
|
|
||||||
</div>
|
|
||||||
<table id="chatuser" class="table table-bordered table-striped" style="width:100%; table-layout:fixed;"></table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-xs-8">
|
|
||||||
<div class="box box-success">
|
|
||||||
<div class="box-header">
|
|
||||||
<h3 class="box-title"><i class='material-icons' style='font-size:16px;'>play_arrow</i> 채팅목록</h3>
|
|
||||||
</div>
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-10 col-xs-12" style="margin-bottom: 10px;">
|
|
||||||
<div class="input-group">
|
|
||||||
<span class="input-group-addon">사용자검색</span>
|
|
||||||
<input type="text" id="userNmLike" class="form-control" placeholder="사용자검색" maxlength="50">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button type="button" class="btn btn-outline-primary" id="searchBtn">검색하기</button>
|
|
||||||
</div>
|
|
||||||
<table id="datatable" class="table table-bordered table-striped" style="width:100%; table-layout:fixed;"></table>
|
|
||||||
</div>
|
|
||||||
<div class="box-footer">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div class="modal fade func-modal" data-keyboard="false" data-backdrop="static" tabindex="-1" role="dialog" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-lg">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h2 id="func-modal-title"></h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
var datatable;
|
|
||||||
$(document).ready(function() {
|
|
||||||
datatable = $("#datatable").DataTable({
|
|
||||||
"searching" : false
|
|
||||||
,"paging": true
|
|
||||||
,"bPaginate": true
|
|
||||||
,"responsive": true
|
|
||||||
,"language": lang_kor
|
|
||||||
,"ajax" : {
|
|
||||||
"url" : "<c:url value='/system/chat/list.json' />"
|
|
||||||
,"method" : "post"
|
|
||||||
// ,"data" : function(d) {
|
|
||||||
// if ($('#pgmNmLike').val() != "") {d.pgmNmLike = $('#pgmNmLike').val(); }
|
|
||||||
// if ($('#pgmUrlLike').val() != "") {d.pgmUrlLike = $('#pgmUrlLike').val(); }
|
|
||||||
// }
|
|
||||||
},"processing": true
|
|
||||||
,"serverSide": true
|
|
||||||
,"order" : [[0, 'desc']]
|
|
||||||
,"columns": [
|
|
||||||
{ "name" : "USER_NM", "title" : "대화상대", "data" : "userNm", "className" : "dt-head-center dt-body-left"},
|
|
||||||
{ "name" : "ROOM_NAME", "title" : "채팅방명", "data" : "roomName", "className" : "dt-head-center dt-body-left"},
|
|
||||||
// { "name" : "REG_DT", "title" : "등록일", "render" :
|
|
||||||
// function (data, type, row) {
|
|
||||||
// return new Date(row["regDt"]).format("yyyy-MM-dd HH:mm:ss");
|
|
||||||
// }, "className" : "dt-head-center dt-body-center"},
|
|
||||||
// { "name" : "UPD_DT", "title" : "수정일", "render" :
|
|
||||||
// function (data, type, row) {
|
|
||||||
// return new Date(row["updDt"]).format("yyyy-MM-dd HH:mm:ss");
|
|
||||||
// }, "className" : "dt-head-center dt-body-center"},
|
|
||||||
// { "render" :
|
|
||||||
// function (data, type, row) {
|
|
||||||
// var html = "";
|
|
||||||
// // html += "<button type='button' class='btn btn-xs btn-outline-primary' data-toggle='tooltip' title='수정' onclick='showUpdateModel(\""+row["pgmId"]+"\")'><i class='material-icons'>create</i></button> ";
|
|
||||||
// html += "<button type='button' class='btn btn-xs btn-outline-primary' data-toggle='tooltip' title='삭제' onclick='del(\""+row["pgmId"]+"\")'><i class='material-icons'>delete</i></button>";
|
|
||||||
// return html;
|
|
||||||
// },
|
|
||||||
// "className": "dt-head-center dt-body-center", "orderable" : false, "title":"기능"
|
|
||||||
// },
|
|
||||||
]
|
|
||||||
,"scrollX": "100%"
|
|
||||||
,"scrollY": "100%"
|
|
||||||
,"scrollXInner": "250px"
|
|
||||||
,"columnDefs": [
|
|
||||||
{"targets": [0], width: "100px"}
|
|
||||||
,{"targets": [1], width: "150px"}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#searchBtn").click(function() {
|
|
||||||
datatable.ajax.reload();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#chatBtn").click(function() {
|
|
||||||
$("#func-modal-title").html("채팅창");
|
|
||||||
$('.func-modal').modal("show");
|
|
||||||
});
|
|
||||||
|
|
||||||
function showUpdateModel(pgmId) {
|
|
||||||
$.ajax({
|
|
||||||
url : "<c:url value='/system/pgm/view.json' />",
|
|
||||||
type : "POST",
|
|
||||||
data : {"pgmId" : pgmId},
|
|
||||||
dataType : "json",
|
|
||||||
success : function(res) {
|
|
||||||
if ("success" == res.result) {
|
|
||||||
var data = res.data;
|
|
||||||
var form = document.funcForm;
|
|
||||||
form.pgmId.value = data.pgmId;
|
|
||||||
form.pgmNm.value = data.pgmNm;
|
|
||||||
form.pgmDesc.value = data.pgmDesc;
|
|
||||||
|
|
||||||
if(data.pgmDesc == null || data.pgmDesc == ""){
|
|
||||||
form.pgmDesc.value = "";
|
|
||||||
}else{
|
|
||||||
form.pgmDesc.value = data.pgmDesc;
|
|
||||||
}
|
|
||||||
|
|
||||||
form.pgmUrl.value = data.pgmUrl;
|
|
||||||
|
|
||||||
if(data.useSt){
|
|
||||||
$("#useSt").bootstrapToggle('on');
|
|
||||||
}else{
|
|
||||||
$("#useSt").bootstrapToggle('off');
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#func-modal-title").html("수정");
|
|
||||||
$('.func-modal').modal("show");
|
|
||||||
}else {
|
|
||||||
alert(res.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function del(pgmId) {
|
|
||||||
if(confirm("삭제하시겠습니까?")) {
|
|
||||||
$.ajax({
|
|
||||||
url : "<c:url value='/system/pgm/delete.json' />",
|
|
||||||
type : "POST",
|
|
||||||
data : {"pgmId" : pgmId},
|
|
||||||
dataType : "json",
|
|
||||||
success : function(res) {
|
|
||||||
if ("success" == res.result) {
|
|
||||||
alert("삭제 되었습니다.");
|
|
||||||
$('.func-modal').modal("hide");
|
|
||||||
datatable.ajax.reload();
|
|
||||||
}else {
|
|
||||||
alert(res.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user