作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

编写后台杂项管理

正在显示 74 个修改的文件 包含 4752 行增加0 行删除

要显示太多修改。

为保证性能只显示 74 of 74+ 个文件。

<?php
namespace addons\summernote;
use think\Addons;
/**
* Summernote富文本编辑器
*/
class Summernote extends Addons
{
/**
* 插件安装方法
* @return bool
*/
public function install()
{
return true;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall()
{
return true;
}
}
... ...
@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("../font/summernote.eot?dbafe969167589eda84514394d126413");src:url("../font/summernote.eot?#iefix") format("embedded-opentype"),url("../font/summernote.woff?dbafe969167589eda84514394d126413") format("woff"),url("../font/summernote.ttf?dbafe969167589eda84514394d126413") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before,.note-icon-align-indent:before,.note-icon-align-justify:before,.note-icon-align-left:before,.note-icon-align-outdent:before,.note-icon-align-right:before,.note-icon-align:before,.note-icon-arrow-circle-down:before,.note-icon-arrow-circle-left:before,.note-icon-arrow-circle-right:before,.note-icon-arrow-circle-up:before,.note-icon-arrows-alt:before,.note-icon-arrows-h:before,.note-icon-arrows-v:before,.note-icon-bold:before,.note-icon-caret:before,.note-icon-chain-broken:before,.note-icon-circle:before,.note-icon-close:before,.note-icon-code:before,.note-icon-col-after:before,.note-icon-col-before:before,.note-icon-col-remove:before,.note-icon-eraser:before,.note-icon-font:before,.note-icon-frame:before,.note-icon-italic:before,.note-icon-link:before,.note-icon-magic:before,.note-icon-menu-check:before,.note-icon-minus:before,.note-icon-orderedlist:before,.note-icon-pencil:before,.note-icon-picture:before,.note-icon-question:before,.note-icon-redo:before,.note-icon-row-above:before,.note-icon-row-below:before,.note-icon-row-remove:before,.note-icon-special-character:before,.note-icon-square:before,.note-icon-strikethrough:before,.note-icon-subscript:before,.note-icon-summernote:before,.note-icon-superscript:before,.note-icon-table:before,.note-icon-text-height:before,.note-icon-trash:before,.note-icon-underline:before,.note-icon-undo:before,.note-icon-unorderedlist:before,.note-icon-video:before{display:inline-block;font-family:"summernote";font-style:normal;font-weight:normal;text-decoration:inherit}.note-icon-align-center:before{content:"\f101"}.note-icon-align-indent:before{content:"\f102"}.note-icon-align-justify:before{content:"\f103"}.note-icon-align-left:before{content:"\f104"}.note-icon-align-outdent:before{content:"\f105"}.note-icon-align-right:before{content:"\f106"}.note-icon-align:before{content:"\f107"}.note-icon-arrow-circle-down:before{content:"\f108"}.note-icon-arrow-circle-left:before{content:"\f109"}.note-icon-arrow-circle-right:before{content:"\f10a"}.note-icon-arrow-circle-up:before{content:"\f10b"}.note-icon-arrows-alt:before{content:"\f10c"}.note-icon-arrows-h:before{content:"\f10d"}.note-icon-arrows-v:before{content:"\f10e"}.note-icon-bold:before{content:"\f10f"}.note-icon-caret:before{content:"\f110"}.note-icon-chain-broken:before{content:"\f111"}.note-icon-circle:before{content:"\f112"}.note-icon-close:before{content:"\f113"}.note-icon-code:before{content:"\f114"}.note-icon-col-after:before{content:"\f115"}.note-icon-col-before:before{content:"\f116"}.note-icon-col-remove:before{content:"\f117"}.note-icon-eraser:before{content:"\f118"}.note-icon-font:before{content:"\f119"}.note-icon-frame:before{content:"\f11a"}.note-icon-italic:before{content:"\f11b"}.note-icon-link:before{content:"\f11c"}.note-icon-magic:before{content:"\f11d"}.note-icon-menu-check:before{content:"\f11e"}.note-icon-minus:before{content:"\f11f"}.note-icon-orderedlist:before{content:"\f120"}.note-icon-pencil:before{content:"\f121"}.note-icon-picture:before{content:"\f122"}.note-icon-question:before{content:"\f123"}.note-icon-redo:before{content:"\f124"}.note-icon-row-above:before{content:"\f125"}.note-icon-row-below:before{content:"\f126"}.note-icon-row-remove:before{content:"\f127"}.note-icon-special-character:before{content:"\f128"}.note-icon-square:before{content:"\f129"}.note-icon-strikethrough:before{content:"\f12a"}.note-icon-subscript:before{content:"\f12b"}.note-icon-summernote:before{content:"\f12c"}.note-icon-superscript:before{content:"\f12d"}.note-icon-table:before{content:"\f12e"}.note-icon-text-height:before{content:"\f12f"}.note-icon-trash:before{content:"\f130"}.note-icon-underline:before{content:"\f131"}.note-icon-undo:before{content:"\f132"}.note-icon-unorderedlist:before{content:"\f133"}.note-icon-video:before{content:"\f134"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:#fff;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:700;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor .note-editing-area img.note-float-left{margin-right:10px}.note-editor .note-editing-area img.note-float-right{margin-left:10px}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;word-wrap:break-word;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:#fff}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-status-output{display:block;width:100%;height:20px;margin-bottom:0;font-size:14px;line-height:1.42857143;color:#000;border:0;border-top:1px solid #e2e2e2}.note-editor.note-frame .note-status-output:empty{height:0;border-top:0 solid transparent}.note-editor.note-frame .note-status-output .pull-right{float:right!important}.note-editor.note-frame .note-status-output .text-muted{color:#777}.note-editor.note-frame .note-status-output .text-primary{color:#286090}.note-editor.note-frame .note-status-output .text-success{color:#3c763d}.note-editor.note-frame .note-status-output .text-info{color:#31708f}.note-editor.note-frame .note-status-output .text-warning{color:#8a6d3b}.note-editor.note-frame .note-status-output .text-danger{color:#a94442}.note-editor.note-frame .note-status-output .alert{padding:7px 10px 2px 10px;margin:-7px 0 0 0;color:#000;background-color:#f5f5f5;border-radius:0}.note-editor.note-frame .note-status-output .alert .note-icon{margin-right:5px}.note-editor.note-frame .note-status-output .alert-success{color:#3c763d!important;background-color:#dff0d8!important}.note-editor.note-frame .note-status-output .alert-info{color:#31708f!important;background-color:#d9edf7!important}.note-editor.note-frame .note-status-output .alert-warning{color:#8a6d3b!important;background-color:#fcf8e3!important}.note-editor.note-frame .note-status-output .alert-danger{color:#a94442!important;background-color:#f2dede!important}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:9px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-statusbar.locked .note-resizebar{cursor:default}.note-editor.note-frame .note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-toolbar{position:relative;z-index:99}.note-popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style .dropdown-style blockquote,.panel-heading.note-toolbar .note-style .dropdown-style blockquote,.note-popover .popover-content .note-style .dropdown-style pre,.panel-heading.note-toolbar .note-style .dropdown-style pre{padding:5px 10px;margin:0}.note-popover .popover-content .note-style .dropdown-style h1,.panel-heading.note-toolbar .note-style .dropdown-style h1,.note-popover .popover-content .note-style .dropdown-style h2,.panel-heading.note-toolbar .note-style .dropdown-style h2,.note-popover .popover-content .note-style .dropdown-style h3,.panel-heading.note-toolbar .note-style .dropdown-style h3,.note-popover .popover-content .note-style .dropdown-style h4,.panel-heading.note-toolbar .note-style .dropdown-style h4,.note-popover .popover-content .note-style .dropdown-style h5,.panel-heading.note-toolbar .note-style .dropdown-style h5,.note-popover .popover-content .note-style .dropdown-style h6,.panel-heading.note-toolbar .note-style .dropdown-style h6,.note-popover .popover-content .note-style .dropdown-style p,.panel-heading.note-toolbar .note-style .dropdown-style p{padding:0;margin:0}.note-popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu,.panel-heading.note-toolbar .note-color .dropdown-menu{min-width:337px}.note-popover .popover-content .note-color .dropdown-menu .note-palette,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette{display:inline-block;width:160px;margin:0}.note-popover .popover-content .note-color .dropdown-menu .note-palette:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}@-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid #000}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:#000;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:#fff;border:1px solid #000}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0}
\ No newline at end of file
... ...
此 diff 太大无法显示。
(function($) {
$.extend($.summernote.lang, {
'zh-CN': {
font: {
bold: '粗体',
italic: '斜体',
underline: '下划线',
clear: '清除格式',
height: '行高',
name: '字体',
strikethrough: '删除线',
subscript: '下标',
superscript: '上标',
size: '字号'
},
image: {
image: '图片',
insert: '插入图片',
resizeFull: '缩放至 100%',
resizeHalf: '缩放至 50%',
resizeQuarter: '缩放至 25%',
floatLeft: '靠左浮动',
floatRight: '靠右浮动',
floatNone: '取消浮动',
shapeRounded: '形状: 圆角',
shapeCircle: '形状: 圆',
shapeThumbnail: '形状: 缩略图',
shapeNone: '形状: 无',
dragImageHere: '将图片拖拽至此处',
dropImage: 'Drop image or Text',
selectFromFiles: '从本地上传',
maximumFileSize: '文件大小最大值',
maximumFileSizeError: '文件大小超出最大值。',
url: '图片地址',
remove: '移除图片',
original: 'Original'
},
video: {
video: '视频',
videoLink: '视频链接',
insert: '插入视频',
url: '视频地址',
providers: '(优酷, 腾讯, Instagram, DailyMotion, Youtube等)'
},
link: {
link: '链接',
insert: '插入链接',
unlink: '去除链接',
edit: '编辑链接',
textToDisplay: '显示文本',
url: '链接地址',
openInNewWindow: '在新窗口打开'
},
table: {
table: '表格',
addRowAbove: 'Add row above',
addRowBelow: 'Add row below',
addColLeft: 'Add column left',
addColRight: 'Add column right',
delRow: 'Delete row',
delCol: 'Delete column',
delTable: 'Delete table'
},
hr: {
insert: '水平线'
},
style: {
style: '样式',
p: '普通',
blockquote: '引用',
pre: '代码',
h1: '标题 1',
h2: '标题 2',
h3: '标题 3',
h4: '标题 4',
h5: '标题 5',
h6: '标题 6'
},
lists: {
unordered: '无序列表',
ordered: '有序列表'
},
options: {
help: '帮助',
fullscreen: '全屏',
codeview: '源代码'
},
paragraph: {
paragraph: '段落',
outdent: '减少缩进',
indent: '增加缩进',
left: '左对齐',
center: '居中对齐',
right: '右对齐',
justify: '两端对齐'
},
color: {
recent: '最近使用',
more: '更多',
background: '背景',
foreground: '前景',
transparent: '透明',
setTransparent: '透明',
reset: '重置',
resetToDefault: '默认'
},
shortcut: {
shortcuts: '快捷键',
close: '关闭',
textFormatting: '文本格式',
action: '动作',
paragraphFormatting: '段落格式',
documentStyle: '文档样式',
extraKeys: '额外按键'
},
help: {
insertParagraph: '插入段落',
undo: '撤销',
redo: '重做',
tab: '增加缩进',
untab: '减少缩进',
bold: '粗体',
italic: '斜体',
underline: '下划线',
strikethrough: '删除线',
removeFormat: '清除格式',
justifyLeft: '左对齐',
justifyCenter: '居中对齐',
justifyRight: '右对齐',
justifyFull: '两端对齐',
insertUnorderedList: '无序列表',
insertOrderedList: '有序列表',
outdent: '减少缩进',
indent: '增加缩进',
formatPara: '设置选中内容样式为 普通',
formatH1: '设置选中内容样式为 标题1',
formatH2: '设置选中内容样式为 标题2',
formatH3: '设置选中内容样式为 标题3',
formatH4: '设置选中内容样式为 标题4',
formatH5: '设置选中内容样式为 标题5',
formatH6: '设置选中内容样式为 标题6',
insertHorizontalRule: '插入水平线',
'linkDialog.show': '显示链接对话框'
},
history: {
undo: '撤销',
redo: '重做'
},
specialChar: {
specialChar: 'SPECIAL CHARACTERS',
select: 'Select Special characters'
}
}
});
})(jQuery);
... ...
/*! Summernote v0.8.10 | (c) 2013- Alan Hong and other contributors | MIT license */
!function(e){e.extend(e.summernote.lang,{"zh-CN":{font:{bold:"粗体",italic:"斜体",underline:"下划线",clear:"清除格式",height:"行高",name:"字体",strikethrough:"删除线",subscript:"下标",superscript:"上标",size:"字号"},image:{image:"图片",insert:"插入图片",resizeFull:"缩放至 100%",resizeHalf:"缩放至 50%",resizeQuarter:"缩放至 25%",floatLeft:"靠左浮动",floatRight:"靠右浮动",floatNone:"取消浮动",shapeRounded:"形状: 圆角",shapeCircle:"形状: 圆",shapeThumbnail:"形状: 缩略图",shapeNone:"形状: 无",dragImageHere:"将图片拖拽至此处",dropImage:"Drop image or Text",selectFromFiles:"从本地上传",maximumFileSize:"文件大小最大值",maximumFileSizeError:"文件大小超出最大值。",url:"图片地址",remove:"移除图片",original:"Original"},video:{video:"视频",videoLink:"视频链接",insert:"插入视频",url:"视频地址",providers:"(优酷, 腾讯, Instagram, DailyMotion, Youtube等)"},link:{link:"链接",insert:"插入链接",unlink:"去除链接",edit:"编辑链接",textToDisplay:"显示文本",url:"链接地址",openInNewWindow:"在新窗口打开"},table:{table:"表格",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"水平线"},style:{style:"样式",p:"普通",blockquote:"引用",pre:"代码",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},lists:{unordered:"无序列表",ordered:"有序列表"},options:{help:"帮助",fullscreen:"全屏",codeview:"源代码"},paragraph:{paragraph:"段落",outdent:"减少缩进",indent:"增加缩进",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐"},color:{recent:"最近使用",more:"更多",background:"背景",foreground:"前景",transparent:"透明",setTransparent:"透明",reset:"重置",resetToDefault:"默认"},shortcut:{shortcuts:"快捷键",close:"关闭",textFormatting:"文本格式",action:"动作",paragraphFormatting:"段落格式",documentStyle:"文档样式",extraKeys:"额外按键"},help:{insertParagraph:"插入段落",undo:"撤销",redo:"重做",tab:"增加缩进",untab:"减少缩进",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",removeFormat:"清除格式",justifyLeft:"左对齐",justifyCenter:"居中对齐",justifyRight:"右对齐",justifyFull:"两端对齐",insertUnorderedList:"无序列表",insertOrderedList:"有序列表",outdent:"减少缩进",indent:"增加缩进",formatPara:"设置选中内容样式为 普通",formatH1:"设置选中内容样式为 标题1",formatH2:"设置选中内容样式为 标题2",formatH3:"设置选中内容样式为 标题3",formatH4:"设置选中内容样式为 标题4",formatH5:"设置选中内容样式为 标题5",formatH6:"设置选中内容样式为 标题6",insertHorizontalRule:"插入水平线","linkDialog.show":"显示链接对话框"},history:{undo:"撤销",redo:"重做"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}})}(jQuery);
\ No newline at end of file
... ...
(function($) {
$.extend($.summernote.lang, {
'zh-TW': {
font: {
bold: '粗體',
italic: '斜體',
underline: '底線',
clear: '清除格式',
height: '行高',
name: '字體',
strikethrough: '刪除線',
subscript: '下標',
superscript: '上標',
size: '字號'
},
image: {
image: '圖片',
insert: '插入圖片',
resizeFull: '縮放至100%',
resizeHalf: '縮放至 50%',
resizeQuarter: '縮放至 25%',
floatLeft: '靠左浮動',
floatRight: '靠右浮動',
floatNone: '取消浮動',
shapeRounded: '形狀: 圓角',
shapeCircle: '形狀: 圓',
shapeThumbnail: '形狀: 縮略圖',
shapeNone: '形狀: 無',
dragImageHere: '將圖片拖曳至此處',
dropImage: 'Drop image or Text',
selectFromFiles: '從本機上傳',
maximumFileSize: '文件大小最大值',
maximumFileSizeError: '文件大小超出最大值。',
url: '圖片網址',
remove: '移除圖片',
original: 'Original'
},
video: {
video: '影片',
videoLink: '影片連結',
insert: '插入影片',
url: '影片網址',
providers: '(優酷, Instagram, DailyMotion, Youtube等)'
},
link: {
link: '連結',
insert: '插入連結',
unlink: '取消連結',
edit: '編輯連結',
textToDisplay: '顯示文字',
url: '連結網址',
openInNewWindow: '在新視窗開啟'
},
table: {
table: '表格',
addRowAbove: 'Add row above',
addRowBelow: 'Add row below',
addColLeft: 'Add column left',
addColRight: 'Add column right',
delRow: 'Delete row',
delCol: 'Delete column',
delTable: 'Delete table'
},
hr: {
insert: '水平線'
},
style: {
style: '樣式',
p: '一般',
blockquote: '引用區塊',
pre: '程式碼區塊',
h1: '標題 1',
h2: '標題 2',
h3: '標題 3',
h4: '標題 4',
h5: '標題 5',
h6: '標題 6'
},
lists: {
unordered: '項目清單',
ordered: '編號清單'
},
options: {
help: '幫助',
fullscreen: '全螢幕',
codeview: '原始碼'
},
paragraph: {
paragraph: '段落',
outdent: '取消縮排',
indent: '增加縮排',
left: '靠右對齊',
center: '靠中對齊',
right: '靠右對齊',
justify: '左右對齊'
},
color: {
recent: '字型顏色',
more: '更多',
background: '背景',
foreground: '前景',
transparent: '透明',
setTransparent: '透明',
reset: '重設',
resetToDefault: '默認'
},
shortcut: {
shortcuts: '快捷鍵',
close: '關閉',
textFormatting: '文字格式',
action: '動作',
paragraphFormatting: '段落格式',
documentStyle: '文件格式',
extraKeys: '額外按鍵'
},
help: {
'insertParagraph': 'Insert Paragraph',
'undo': 'Undoes the last command',
'redo': 'Redoes the last command',
'tab': 'Tab',
'untab': 'Untab',
'bold': 'Set a bold style',
'italic': 'Set a italic style',
'underline': 'Set a underline style',
'strikethrough': 'Set a strikethrough style',
'removeFormat': 'Clean a style',
'justifyLeft': 'Set left align',
'justifyCenter': 'Set center align',
'justifyRight': 'Set right align',
'justifyFull': 'Set full align',
'insertUnorderedList': 'Toggle unordered list',
'insertOrderedList': 'Toggle ordered list',
'outdent': 'Outdent on current paragraph',
'indent': 'Indent on current paragraph',
'formatPara': 'Change current block\'s format as a paragraph(P tag)',
'formatH1': 'Change current block\'s format as H1',
'formatH2': 'Change current block\'s format as H2',
'formatH3': 'Change current block\'s format as H3',
'formatH4': 'Change current block\'s format as H4',
'formatH5': 'Change current block\'s format as H5',
'formatH6': 'Change current block\'s format as H6',
'insertHorizontalRule': 'Insert horizontal rule',
'linkDialog.show': 'Show Link Dialog'
},
history: {
undo: '復原',
redo: '取消復原'
},
specialChar: {
specialChar: 'SPECIAL CHARACTERS',
select: 'Select Special characters'
}
}
});
})(jQuery);
... ...
/*! Summernote v0.8.10 | (c) 2013- Alan Hong and other contributors | MIT license */
!function(e){e.extend(e.summernote.lang,{"zh-TW":{font:{bold:"粗體",italic:"斜體",underline:"底線",clear:"清除格式",height:"行高",name:"字體",strikethrough:"刪除線",subscript:"下標",superscript:"上標",size:"字號"},image:{image:"圖片",insert:"插入圖片",resizeFull:"縮放至100%",resizeHalf:"縮放至 50%",resizeQuarter:"縮放至 25%",floatLeft:"靠左浮動",floatRight:"靠右浮動",floatNone:"取消浮動",shapeRounded:"形狀: 圓角",shapeCircle:"形狀: 圓",shapeThumbnail:"形狀: 縮略圖",shapeNone:"形狀: 無",dragImageHere:"將圖片拖曳至此處",dropImage:"Drop image or Text",selectFromFiles:"從本機上傳",maximumFileSize:"文件大小最大值",maximumFileSizeError:"文件大小超出最大值。",url:"圖片網址",remove:"移除圖片",original:"Original"},video:{video:"影片",videoLink:"影片連結",insert:"插入影片",url:"影片網址",providers:"(優酷, Instagram, DailyMotion, Youtube等)"},link:{link:"連結",insert:"插入連結",unlink:"取消連結",edit:"編輯連結",textToDisplay:"顯示文字",url:"連結網址",openInNewWindow:"在新視窗開啟"},table:{table:"表格",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"水平線"},style:{style:"樣式",p:"一般",blockquote:"引用區塊",pre:"程式碼區塊",h1:"標題 1",h2:"標題 2",h3:"標題 3",h4:"標題 4",h5:"標題 5",h6:"標題 6"},lists:{unordered:"項目清單",ordered:"編號清單"},options:{help:"幫助",fullscreen:"全螢幕",codeview:"原始碼"},paragraph:{paragraph:"段落",outdent:"取消縮排",indent:"增加縮排",left:"靠右對齊",center:"靠中對齊",right:"靠右對齊",justify:"左右對齊"},color:{recent:"字型顏色",more:"更多",background:"背景",foreground:"前景",transparent:"透明",setTransparent:"透明",reset:"重設",resetToDefault:"默認"},shortcut:{shortcuts:"快捷鍵",close:"關閉",textFormatting:"文字格式",action:"動作",paragraphFormatting:"段落格式",documentStyle:"文件格式",extraKeys:"額外按鍵"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"復原",redo:"取消復原"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}})}(jQuery);
\ No newline at end of file
... ...
require.config({
paths: {
'summernote': '../addons/summernote/lang/summernote-zh-CN.min'
},
shim: {
'summernote': ['../addons/summernote/js/summernote.min', 'css!../addons/summernote/css/summernote.css'],
}
});
require(['form', 'upload'], function (Form, Upload) {
var _bindevent = Form.events.bindevent;
Form.events.bindevent = function (form) {
_bindevent.apply(this, [form]);
try {
//绑定summernote事件
if ($(".summernote,.editor", form).size() > 0) {
require(['summernote'], function () {
var imageButton = function (context) {
var ui = $.summernote.ui;
var button = ui.button({
contents: '<i class="fa fa-file-image-o"/>',
tooltip: __('Choose'),
click: function () {
parent.Fast.api.open("general/attachment/select?element_id=&multiple=true&mimetype=image/*", __('Choose'), {
callback: function (data) {
var urlArr = data.url.split(/\,/);
$.each(urlArr, function () {
var url = Fast.api.cdnurl(this);
context.invoke('editor.insertImage', url);
});
}
});
return false;
}
});
return button.render();
};
var attachmentButton = function (context) {
var ui = $.summernote.ui;
var button = ui.button({
contents: '<i class="fa fa-file"/>',
tooltip: __('Choose'),
click: function () {
parent.Fast.api.open("general/attachment/select?element_id=&multiple=true&mimetype=*", __('Choose'), {
callback: function (data) {
var urlArr = data.url.split(/\,/);
$.each(urlArr, function () {
var url = Fast.api.cdnurl(this);
var node = $("<a href='" + url + "'>" + url + "</a>");
context.invoke('insertNode', node[0]);
});
}
});
return false;
}
});
return button.render();
};
$(".summernote,.editor", form).summernote({
height: 250,
lang: 'zh-CN',
fontNames: [
'Arial', 'Arial Black', 'Serif', 'Sans', 'Courier',
'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande',
"Open Sans", "Hiragino Sans GB", "Microsoft YaHei",
'微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆',
],
fontNamesIgnoreCheck: [
"Open Sans", "Microsoft YaHei",
'微软雅黑', '宋体', '黑体', '仿宋', '楷体', '幼圆'
],
toolbar: [
['style', ['style', 'undo', 'redo']],
['font', ['bold', 'underline', 'strikethrough', 'clear']],
['fontname', ['color', 'fontname', 'fontsize']],
['para', ['ul', 'ol', 'paragraph', 'height']],
['table', ['table', 'hr']],
['insert', ['link', 'picture', 'video']],
['select', ['image', 'attachment']],
['view', ['fullscreen', 'codeview', 'help']],
],
buttons: {
image: imageButton,
attachment: attachmentButton,
},
dialogsInBody: true,
followingToolbar: false,
callbacks: {
onChange: function (contents) {
$(this).val(contents);
$(this).trigger('change');
},
onInit: function () {
},
onImageUpload: function (files) {
var that = this;
//依次上传图片
for (var i = 0; i < files.length; i++) {
Upload.api.send(files[i], function (data) {
var url = Fast.api.cdnurl(data.url);
$(that).summernote("insertImage", url, 'filename');
});
}
}
}
});
});
}
} catch (e) {
}
};
});
... ...
<?php
return [
];
... ...
<?php
namespace addons\summernote\controller;
use think\addons\Controller;
class Index extends Controller
{
public function index()
{
$this->error("当前插件暂无前台页面");
}
}
... ...
name = summernote
title = Summernote富文本编辑器
intro = 修改后台默认编辑器为Summernote
author = Karson
website = http://www.fastadmin.net
version = 1.0.4
state = 1
url = /addons/summernote
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 用户须知内容
*
* @icon fa fa-circle-o
*/
class Need extends Backend
{
/**
* Need模型对象
* @var \app\admin\model\Need
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Need;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 成为老师文案
*
* @icon fa fa-circle-o
*/
class Official extends Backend
{
/**
* Official模型对象
* @var \app\admin\model\Official
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Official;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
}
... ...
<?php
return [
'Id' => 'ID',
'Content' => '用户须知内容',
'Createtime' => '创建时间',
'Updatetime' => '修改时间'
];
... ...
<?php
return [
'Id' => 'ID',
'Content' => '成为老师文案',
'Createtime' => '创建时间',
'Updatetime' => '修改时间'
];
... ...
<?php
namespace app\admin\model;
use think\Model;
class Need extends Model
{
// 表名
protected $name = 'need';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class Official extends Model
{
// 表名
protected $name = 'official';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Need extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Official extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('need/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('need/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('need/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('need/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('need/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('need/edit')}"
data-operate-del="{:$auth->check('need/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('official/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('official/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('official/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('official/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('official/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('official/edit')}"
data-operate-del="{:$auth->check('official/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("../font/summernote.eot?dbafe969167589eda84514394d126413");src:url("../font/summernote.eot?#iefix") format("embedded-opentype"),url("../font/summernote.woff?dbafe969167589eda84514394d126413") format("woff"),url("../font/summernote.ttf?dbafe969167589eda84514394d126413") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before,.note-icon-align-indent:before,.note-icon-align-justify:before,.note-icon-align-left:before,.note-icon-align-outdent:before,.note-icon-align-right:before,.note-icon-align:before,.note-icon-arrow-circle-down:before,.note-icon-arrow-circle-left:before,.note-icon-arrow-circle-right:before,.note-icon-arrow-circle-up:before,.note-icon-arrows-alt:before,.note-icon-arrows-h:before,.note-icon-arrows-v:before,.note-icon-bold:before,.note-icon-caret:before,.note-icon-chain-broken:before,.note-icon-circle:before,.note-icon-close:before,.note-icon-code:before,.note-icon-col-after:before,.note-icon-col-before:before,.note-icon-col-remove:before,.note-icon-eraser:before,.note-icon-font:before,.note-icon-frame:before,.note-icon-italic:before,.note-icon-link:before,.note-icon-magic:before,.note-icon-menu-check:before,.note-icon-minus:before,.note-icon-orderedlist:before,.note-icon-pencil:before,.note-icon-picture:before,.note-icon-question:before,.note-icon-redo:before,.note-icon-row-above:before,.note-icon-row-below:before,.note-icon-row-remove:before,.note-icon-special-character:before,.note-icon-square:before,.note-icon-strikethrough:before,.note-icon-subscript:before,.note-icon-summernote:before,.note-icon-superscript:before,.note-icon-table:before,.note-icon-text-height:before,.note-icon-trash:before,.note-icon-underline:before,.note-icon-undo:before,.note-icon-unorderedlist:before,.note-icon-video:before{display:inline-block;font-family:"summernote";font-style:normal;font-weight:normal;text-decoration:inherit}.note-icon-align-center:before{content:"\f101"}.note-icon-align-indent:before{content:"\f102"}.note-icon-align-justify:before{content:"\f103"}.note-icon-align-left:before{content:"\f104"}.note-icon-align-outdent:before{content:"\f105"}.note-icon-align-right:before{content:"\f106"}.note-icon-align:before{content:"\f107"}.note-icon-arrow-circle-down:before{content:"\f108"}.note-icon-arrow-circle-left:before{content:"\f109"}.note-icon-arrow-circle-right:before{content:"\f10a"}.note-icon-arrow-circle-up:before{content:"\f10b"}.note-icon-arrows-alt:before{content:"\f10c"}.note-icon-arrows-h:before{content:"\f10d"}.note-icon-arrows-v:before{content:"\f10e"}.note-icon-bold:before{content:"\f10f"}.note-icon-caret:before{content:"\f110"}.note-icon-chain-broken:before{content:"\f111"}.note-icon-circle:before{content:"\f112"}.note-icon-close:before{content:"\f113"}.note-icon-code:before{content:"\f114"}.note-icon-col-after:before{content:"\f115"}.note-icon-col-before:before{content:"\f116"}.note-icon-col-remove:before{content:"\f117"}.note-icon-eraser:before{content:"\f118"}.note-icon-font:before{content:"\f119"}.note-icon-frame:before{content:"\f11a"}.note-icon-italic:before{content:"\f11b"}.note-icon-link:before{content:"\f11c"}.note-icon-magic:before{content:"\f11d"}.note-icon-menu-check:before{content:"\f11e"}.note-icon-minus:before{content:"\f11f"}.note-icon-orderedlist:before{content:"\f120"}.note-icon-pencil:before{content:"\f121"}.note-icon-picture:before{content:"\f122"}.note-icon-question:before{content:"\f123"}.note-icon-redo:before{content:"\f124"}.note-icon-row-above:before{content:"\f125"}.note-icon-row-below:before{content:"\f126"}.note-icon-row-remove:before{content:"\f127"}.note-icon-special-character:before{content:"\f128"}.note-icon-square:before{content:"\f129"}.note-icon-strikethrough:before{content:"\f12a"}.note-icon-subscript:before{content:"\f12b"}.note-icon-summernote:before{content:"\f12c"}.note-icon-superscript:before{content:"\f12d"}.note-icon-table:before{content:"\f12e"}.note-icon-text-height:before{content:"\f12f"}.note-icon-trash:before{content:"\f130"}.note-icon-underline:before{content:"\f131"}.note-icon-undo:before{content:"\f132"}.note-icon-unorderedlist:before{content:"\f133"}.note-icon-video:before{content:"\f134"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:#fff;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:700;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor .note-editing-area img.note-float-left{margin-right:10px}.note-editor .note-editing-area img.note-float-right{margin-left:10px}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;word-wrap:break-word;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:#fff}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-status-output{display:block;width:100%;height:20px;margin-bottom:0;font-size:14px;line-height:1.42857143;color:#000;border:0;border-top:1px solid #e2e2e2}.note-editor.note-frame .note-status-output:empty{height:0;border-top:0 solid transparent}.note-editor.note-frame .note-status-output .pull-right{float:right!important}.note-editor.note-frame .note-status-output .text-muted{color:#777}.note-editor.note-frame .note-status-output .text-primary{color:#286090}.note-editor.note-frame .note-status-output .text-success{color:#3c763d}.note-editor.note-frame .note-status-output .text-info{color:#31708f}.note-editor.note-frame .note-status-output .text-warning{color:#8a6d3b}.note-editor.note-frame .note-status-output .text-danger{color:#a94442}.note-editor.note-frame .note-status-output .alert{padding:7px 10px 2px 10px;margin:-7px 0 0 0;color:#000;background-color:#f5f5f5;border-radius:0}.note-editor.note-frame .note-status-output .alert .note-icon{margin-right:5px}.note-editor.note-frame .note-status-output .alert-success{color:#3c763d!important;background-color:#dff0d8!important}.note-editor.note-frame .note-status-output .alert-info{color:#31708f!important;background-color:#d9edf7!important}.note-editor.note-frame .note-status-output .alert-warning{color:#8a6d3b!important;background-color:#fcf8e3!important}.note-editor.note-frame .note-status-output .alert-danger{color:#a94442!important;background-color:#f2dede!important}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:9px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-statusbar.locked .note-resizebar{cursor:default}.note-editor.note-frame .note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-toolbar{position:relative;z-index:99}.note-popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style .dropdown-style blockquote,.panel-heading.note-toolbar .note-style .dropdown-style blockquote,.note-popover .popover-content .note-style .dropdown-style pre,.panel-heading.note-toolbar .note-style .dropdown-style pre{padding:5px 10px;margin:0}.note-popover .popover-content .note-style .dropdown-style h1,.panel-heading.note-toolbar .note-style .dropdown-style h1,.note-popover .popover-content .note-style .dropdown-style h2,.panel-heading.note-toolbar .note-style .dropdown-style h2,.note-popover .popover-content .note-style .dropdown-style h3,.panel-heading.note-toolbar .note-style .dropdown-style h3,.note-popover .popover-content .note-style .dropdown-style h4,.panel-heading.note-toolbar .note-style .dropdown-style h4,.note-popover .popover-content .note-style .dropdown-style h5,.panel-heading.note-toolbar .note-style .dropdown-style h5,.note-popover .popover-content .note-style .dropdown-style h6,.panel-heading.note-toolbar .note-style .dropdown-style h6,.note-popover .popover-content .note-style .dropdown-style p,.panel-heading.note-toolbar .note-style .dropdown-style p{padding:0;margin:0}.note-popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu,.panel-heading.note-toolbar .note-color .dropdown-menu{min-width:337px}.note-popover .popover-content .note-color .dropdown-menu .note-palette,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette{display:inline-block;width:160px;margin:0}.note-popover .popover-content .note-color .dropdown-menu .note-palette:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}@-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid #000}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:#000;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:#fff;border:1px solid #000}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0}
\ No newline at end of file
... ...
(function($) {
$.extend($.summernote.lang, {
'zh-CN': {
font: {
bold: '粗体',
italic: '斜体',
underline: '下划线',
clear: '清除格式',
height: '行高',
name: '字体',
strikethrough: '删除线',
subscript: '下标',
superscript: '上标',
size: '字号'
},
image: {
image: '图片',
insert: '插入图片',
resizeFull: '缩放至 100%',
resizeHalf: '缩放至 50%',
resizeQuarter: '缩放至 25%',
floatLeft: '靠左浮动',
floatRight: '靠右浮动',
floatNone: '取消浮动',
shapeRounded: '形状: 圆角',
shapeCircle: '形状: 圆',
shapeThumbnail: '形状: 缩略图',
shapeNone: '形状: 无',
dragImageHere: '将图片拖拽至此处',
dropImage: 'Drop image or Text',
selectFromFiles: '从本地上传',
maximumFileSize: '文件大小最大值',
maximumFileSizeError: '文件大小超出最大值。',
url: '图片地址',
remove: '移除图片',
original: 'Original'
},
video: {
video: '视频',
videoLink: '视频链接',
insert: '插入视频',
url: '视频地址',
providers: '(优酷, 腾讯, Instagram, DailyMotion, Youtube等)'
},
link: {
link: '链接',
insert: '插入链接',
unlink: '去除链接',
edit: '编辑链接',
textToDisplay: '显示文本',
url: '链接地址',
openInNewWindow: '在新窗口打开'
},
table: {
table: '表格',
addRowAbove: 'Add row above',
addRowBelow: 'Add row below',
addColLeft: 'Add column left',
addColRight: 'Add column right',
delRow: 'Delete row',
delCol: 'Delete column',
delTable: 'Delete table'
},
hr: {
insert: '水平线'
},
style: {
style: '样式',
p: '普通',
blockquote: '引用',
pre: '代码',
h1: '标题 1',
h2: '标题 2',
h3: '标题 3',
h4: '标题 4',
h5: '标题 5',
h6: '标题 6'
},
lists: {
unordered: '无序列表',
ordered: '有序列表'
},
options: {
help: '帮助',
fullscreen: '全屏',
codeview: '源代码'
},
paragraph: {
paragraph: '段落',
outdent: '减少缩进',
indent: '增加缩进',
left: '左对齐',
center: '居中对齐',
right: '右对齐',
justify: '两端对齐'
},
color: {
recent: '最近使用',
more: '更多',
background: '背景',
foreground: '前景',
transparent: '透明',
setTransparent: '透明',
reset: '重置',
resetToDefault: '默认'
},
shortcut: {
shortcuts: '快捷键',
close: '关闭',
textFormatting: '文本格式',
action: '动作',
paragraphFormatting: '段落格式',
documentStyle: '文档样式',
extraKeys: '额外按键'
},
help: {
insertParagraph: '插入段落',
undo: '撤销',
redo: '重做',
tab: '增加缩进',
untab: '减少缩进',
bold: '粗体',
italic: '斜体',
underline: '下划线',
strikethrough: '删除线',
removeFormat: '清除格式',
justifyLeft: '左对齐',
justifyCenter: '居中对齐',
justifyRight: '右对齐',
justifyFull: '两端对齐',
insertUnorderedList: '无序列表',
insertOrderedList: '有序列表',
outdent: '减少缩进',
indent: '增加缩进',
formatPara: '设置选中内容样式为 普通',
formatH1: '设置选中内容样式为 标题1',
formatH2: '设置选中内容样式为 标题2',
formatH3: '设置选中内容样式为 标题3',
formatH4: '设置选中内容样式为 标题4',
formatH5: '设置选中内容样式为 标题5',
formatH6: '设置选中内容样式为 标题6',
insertHorizontalRule: '插入水平线',
'linkDialog.show': '显示链接对话框'
},
history: {
undo: '撤销',
redo: '重做'
},
specialChar: {
specialChar: 'SPECIAL CHARACTERS',
select: 'Select Special characters'
}
}
});
})(jQuery);
... ...
/*! Summernote v0.8.10 | (c) 2013- Alan Hong and other contributors | MIT license */
!function(e){e.extend(e.summernote.lang,{"zh-CN":{font:{bold:"粗体",italic:"斜体",underline:"下划线",clear:"清除格式",height:"行高",name:"字体",strikethrough:"删除线",subscript:"下标",superscript:"上标",size:"字号"},image:{image:"图片",insert:"插入图片",resizeFull:"缩放至 100%",resizeHalf:"缩放至 50%",resizeQuarter:"缩放至 25%",floatLeft:"靠左浮动",floatRight:"靠右浮动",floatNone:"取消浮动",shapeRounded:"形状: 圆角",shapeCircle:"形状: 圆",shapeThumbnail:"形状: 缩略图",shapeNone:"形状: 无",dragImageHere:"将图片拖拽至此处",dropImage:"Drop image or Text",selectFromFiles:"从本地上传",maximumFileSize:"文件大小最大值",maximumFileSizeError:"文件大小超出最大值。",url:"图片地址",remove:"移除图片",original:"Original"},video:{video:"视频",videoLink:"视频链接",insert:"插入视频",url:"视频地址",providers:"(优酷, 腾讯, Instagram, DailyMotion, Youtube等)"},link:{link:"链接",insert:"插入链接",unlink:"去除链接",edit:"编辑链接",textToDisplay:"显示文本",url:"链接地址",openInNewWindow:"在新窗口打开"},table:{table:"表格",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"水平线"},style:{style:"样式",p:"普通",blockquote:"引用",pre:"代码",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},lists:{unordered:"无序列表",ordered:"有序列表"},options:{help:"帮助",fullscreen:"全屏",codeview:"源代码"},paragraph:{paragraph:"段落",outdent:"减少缩进",indent:"增加缩进",left:"左对齐",center:"居中对齐",right:"右对齐",justify:"两端对齐"},color:{recent:"最近使用",more:"更多",background:"背景",foreground:"前景",transparent:"透明",setTransparent:"透明",reset:"重置",resetToDefault:"默认"},shortcut:{shortcuts:"快捷键",close:"关闭",textFormatting:"文本格式",action:"动作",paragraphFormatting:"段落格式",documentStyle:"文档样式",extraKeys:"额外按键"},help:{insertParagraph:"插入段落",undo:"撤销",redo:"重做",tab:"增加缩进",untab:"减少缩进",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",removeFormat:"清除格式",justifyLeft:"左对齐",justifyCenter:"居中对齐",justifyRight:"右对齐",justifyFull:"两端对齐",insertUnorderedList:"无序列表",insertOrderedList:"有序列表",outdent:"减少缩进",indent:"增加缩进",formatPara:"设置选中内容样式为 普通",formatH1:"设置选中内容样式为 标题1",formatH2:"设置选中内容样式为 标题2",formatH3:"设置选中内容样式为 标题3",formatH4:"设置选中内容样式为 标题4",formatH5:"设置选中内容样式为 标题5",formatH6:"设置选中内容样式为 标题6",insertHorizontalRule:"插入水平线","linkDialog.show":"显示链接对话框"},history:{undo:"撤销",redo:"重做"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}})}(jQuery);
\ No newline at end of file
... ...
(function($) {
$.extend($.summernote.lang, {
'zh-TW': {
font: {
bold: '粗體',
italic: '斜體',
underline: '底線',
clear: '清除格式',
height: '行高',
name: '字體',
strikethrough: '刪除線',
subscript: '下標',
superscript: '上標',
size: '字號'
},
image: {
image: '圖片',
insert: '插入圖片',
resizeFull: '縮放至100%',
resizeHalf: '縮放至 50%',
resizeQuarter: '縮放至 25%',
floatLeft: '靠左浮動',
floatRight: '靠右浮動',
floatNone: '取消浮動',
shapeRounded: '形狀: 圓角',
shapeCircle: '形狀: 圓',
shapeThumbnail: '形狀: 縮略圖',
shapeNone: '形狀: 無',
dragImageHere: '將圖片拖曳至此處',
dropImage: 'Drop image or Text',
selectFromFiles: '從本機上傳',
maximumFileSize: '文件大小最大值',
maximumFileSizeError: '文件大小超出最大值。',
url: '圖片網址',
remove: '移除圖片',
original: 'Original'
},
video: {
video: '影片',
videoLink: '影片連結',
insert: '插入影片',
url: '影片網址',
providers: '(優酷, Instagram, DailyMotion, Youtube等)'
},
link: {
link: '連結',
insert: '插入連結',
unlink: '取消連結',
edit: '編輯連結',
textToDisplay: '顯示文字',
url: '連結網址',
openInNewWindow: '在新視窗開啟'
},
table: {
table: '表格',
addRowAbove: 'Add row above',
addRowBelow: 'Add row below',
addColLeft: 'Add column left',
addColRight: 'Add column right',
delRow: 'Delete row',
delCol: 'Delete column',
delTable: 'Delete table'
},
hr: {
insert: '水平線'
},
style: {
style: '樣式',
p: '一般',
blockquote: '引用區塊',
pre: '程式碼區塊',
h1: '標題 1',
h2: '標題 2',
h3: '標題 3',
h4: '標題 4',
h5: '標題 5',
h6: '標題 6'
},
lists: {
unordered: '項目清單',
ordered: '編號清單'
},
options: {
help: '幫助',
fullscreen: '全螢幕',
codeview: '原始碼'
},
paragraph: {
paragraph: '段落',
outdent: '取消縮排',
indent: '增加縮排',
left: '靠右對齊',
center: '靠中對齊',
right: '靠右對齊',
justify: '左右對齊'
},
color: {
recent: '字型顏色',
more: '更多',
background: '背景',
foreground: '前景',
transparent: '透明',
setTransparent: '透明',
reset: '重設',
resetToDefault: '默認'
},
shortcut: {
shortcuts: '快捷鍵',
close: '關閉',
textFormatting: '文字格式',
action: '動作',
paragraphFormatting: '段落格式',
documentStyle: '文件格式',
extraKeys: '額外按鍵'
},
help: {
'insertParagraph': 'Insert Paragraph',
'undo': 'Undoes the last command',
'redo': 'Redoes the last command',
'tab': 'Tab',
'untab': 'Untab',
'bold': 'Set a bold style',
'italic': 'Set a italic style',
'underline': 'Set a underline style',
'strikethrough': 'Set a strikethrough style',
'removeFormat': 'Clean a style',
'justifyLeft': 'Set left align',
'justifyCenter': 'Set center align',
'justifyRight': 'Set right align',
'justifyFull': 'Set full align',
'insertUnorderedList': 'Toggle unordered list',
'insertOrderedList': 'Toggle ordered list',
'outdent': 'Outdent on current paragraph',
'indent': 'Indent on current paragraph',
'formatPara': 'Change current block\'s format as a paragraph(P tag)',
'formatH1': 'Change current block\'s format as H1',
'formatH2': 'Change current block\'s format as H2',
'formatH3': 'Change current block\'s format as H3',
'formatH4': 'Change current block\'s format as H4',
'formatH5': 'Change current block\'s format as H5',
'formatH6': 'Change current block\'s format as H6',
'insertHorizontalRule': 'Insert horizontal rule',
'linkDialog.show': 'Show Link Dialog'
},
history: {
undo: '復原',
redo: '取消復原'
},
specialChar: {
specialChar: 'SPECIAL CHARACTERS',
select: 'Select Special characters'
}
}
});
})(jQuery);
... ...
/*! Summernote v0.8.10 | (c) 2013- Alan Hong and other contributors | MIT license */
!function(e){e.extend(e.summernote.lang,{"zh-TW":{font:{bold:"粗體",italic:"斜體",underline:"底線",clear:"清除格式",height:"行高",name:"字體",strikethrough:"刪除線",subscript:"下標",superscript:"上標",size:"字號"},image:{image:"圖片",insert:"插入圖片",resizeFull:"縮放至100%",resizeHalf:"縮放至 50%",resizeQuarter:"縮放至 25%",floatLeft:"靠左浮動",floatRight:"靠右浮動",floatNone:"取消浮動",shapeRounded:"形狀: 圓角",shapeCircle:"形狀: 圓",shapeThumbnail:"形狀: 縮略圖",shapeNone:"形狀: 無",dragImageHere:"將圖片拖曳至此處",dropImage:"Drop image or Text",selectFromFiles:"從本機上傳",maximumFileSize:"文件大小最大值",maximumFileSizeError:"文件大小超出最大值。",url:"圖片網址",remove:"移除圖片",original:"Original"},video:{video:"影片",videoLink:"影片連結",insert:"插入影片",url:"影片網址",providers:"(優酷, Instagram, DailyMotion, Youtube等)"},link:{link:"連結",insert:"插入連結",unlink:"取消連結",edit:"編輯連結",textToDisplay:"顯示文字",url:"連結網址",openInNewWindow:"在新視窗開啟"},table:{table:"表格",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"水平線"},style:{style:"樣式",p:"一般",blockquote:"引用區塊",pre:"程式碼區塊",h1:"標題 1",h2:"標題 2",h3:"標題 3",h4:"標題 4",h5:"標題 5",h6:"標題 6"},lists:{unordered:"項目清單",ordered:"編號清單"},options:{help:"幫助",fullscreen:"全螢幕",codeview:"原始碼"},paragraph:{paragraph:"段落",outdent:"取消縮排",indent:"增加縮排",left:"靠右對齊",center:"靠中對齊",right:"靠右對齊",justify:"左右對齊"},color:{recent:"字型顏色",more:"更多",background:"背景",foreground:"前景",transparent:"透明",setTransparent:"透明",reset:"重設",resetToDefault:"默認"},shortcut:{shortcuts:"快捷鍵",close:"關閉",textFormatting:"文字格式",action:"動作",paragraphFormatting:"段落格式",documentStyle:"文件格式",extraKeys:"額外按鍵"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"復原",redo:"取消復原"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}})}(jQuery);
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'need/index' + location.search,
add_url: 'need/add',
edit_url: 'need/edit',
del_url: 'need/del',
multi_url: 'need/multi',
table: 'need',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
var that = $.extend({}, this);
var table = $(that.table).clone(true);
$(table).data("operate-del", null);
that.table = table;
return Table.api.formatter.operate.call(that, value, row, index);
}}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'official/index' + location.search,
add_url: 'official/add',
edit_url: 'official/edit',
del_url: 'official/del',
multi_url: 'official/multi',
table: 'official',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
var that = $.extend({}, this);
var table = $(that.table).clone(true);
$(table).data("operate-del", null);
that.table = table;
return Table.api.formatter.operate.call(that, value, row, index);
}}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
The MIT License (MIT)
Copyright (c) 2019 Rong Cloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
... ...
server-sdk-php
=================
Rong Cloud Server SDK in PHP.
# 版本说明
为方便开发者的接入使用,更好的对融云 Server SDK 进行维护管理,融云 Server SDK 3.0 统一规范了命名及调用方式,结构更加清晰。老版本的 Server SDK 仍然可以使用,但不会再做新的功能更新。
如果您是新接入的开发者,建议您使用 Server SDK 3.0 版本。 对已集成使用老版本 Server SDK 的开发者,不能直接升级使用,强烈建议您重新测试后使用
# API文档
- 官方文档(https://www.rongcloud.cn/docs/server_sdk_api/)
# 使用教程
* 请参考 example 上面提供了所有的 API 接口的调用用例。
... ...
<?php
function autoload($class){
if(is_file(str_replace("\\", "/", RONGCLOUOD_ROOT.'../'."$class".'.'.'php'))){
require(str_replace("\\", "/", RONGCLOUOD_ROOT.'../'."$class".'.'.'php'));
}
}
spl_autoload_register("autoload");
... ...
<?php
/**
* 聊天室全局禁言
*/
namespace RongCloud\Lib\Chatroom\Ban;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Ban {
/**
* 聊天室全局禁言路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Ban/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Ban constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加聊天室全局禁言
*
* @param array $Chatroom
* $Chatroom = [
'members'=> [
['id'=>'seal9901']//人员 id
],
'minute'=>30//禁言时长
];
* @return mixed|null
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['chatroom'] ;
$verify = ['members'=>$verify['members'],'minute'=>$verify['minute']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取聊天室全局禁言列表
*
* @param array $Chatroom
* $Chatroom = [
'members'=> [
['id'=>'seal9901']//成员 id
]
];
* @return mixed|null
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['chatroom'] ;
$verify = ['members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 添加封禁
*
* @param array $Chatroom
* $Chatroom = [
];
* @return mixed|null
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['users'=>'members']);
foreach ($result['members'] as $k=>&$v){
$v = (new Utils())->rename($v,['userId'=>'id']);
}
}
return $result;
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_ban_add",
"url": "chatroom/user/ban/add",
"params": {
"chatroom": {
"members": [{
"id": "akfj0a1"
}],
"minute": 100
}
},
"response": {
"success": {
"code": 200,
"msg": "成功返回"
},
"fail": {
"1502": {
"code": "1502",
"msg": "封禁时间不正确, 当前传入为 {{size}}, 正确范围 1 - 1 * 30 * 24 * 60 分钟"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_ban_remove",
"url": "chatroom/user/ban/remove",
"params": {
"chatroom": {
"members": [{
"id": "akfj0a1"
}]
}
},
"response": {
"success": {
"code": 200,
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_ban_query",
"url": "chatroom/user/ban/query",
"params": {},
"response": {
"success": {
"code": "200",
"members": [{
"time": "2015-09-25 16:12:38",
"id": "2582"
}]
},
"fail": {
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室封禁
*/
namespace RongCloud\Lib\Chatroom\Block;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Block {
/**
* 聊天室封禁路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Block/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Block constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加封禁
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
'members'=> [
['id'=>'seal9901']//封禁成员 id
],
'minute'=>30//封禁时长
];
* @return mixed|null
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members'],'minute'=>$verify['minute']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=> 'chatroomId',
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 解除封禁
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
'members'=> [
['id'=>'seal9901']//解除封禁成员 id
],
];
* @return mixed|null
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=> 'chatroomId',
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 查询被封禁成员列表
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'chatroom9992',//聊天室 id
];
* @return mixed|null
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=> 'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['users'=>'members']);
foreach ($result['members'] as $k=>&$v){
$v = (new Utils())->rename($v,['userId'=>'id']);
}
}
return $result;
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_block_add",
"url": "chatroom/user/block/add",
"params": {
"chatroom": {
"id": "chatroomId01",
"members": [{
"id": "akfj0a1"
}],
"minute": 10
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1502": {
"code": "1502",
"msg": "封禁时间不正确, 当前传入为 {{size}}, 正确范围 1 - 1 * 30 * 24 * 60 分钟"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_block_rollback",
"url": "chatroom/user/block/rollback",
"params": {
"chatroom": {
"id": "chatroomId01",
"members": [{
"id": "akfj0a1"
}]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_block_list",
"url": "chatroom/user/block/list",
"params": {
"chatroom": {
"id": "chatroomId01"
}
},
"response": {
"success": {
"code": "200",
"blockMembers": [{
"time": "2015-09-25 16:12:38",
"id": "2582"
}]
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室
*/
namespace RongCloud\Lib\Chatroom;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
use RongCloud\Lib\Chatroom\Ban\Ban;
use RongCloud\Lib\Chatroom\Block\Block;
use RongCloud\Lib\Chatroom\Demotion\Demotion;
use RongCloud\Lib\Chatroom\Distribute\Distribute;
use RongCloud\Lib\Chatroom\Gag\Gag;
use RongCloud\Lib\Chatroom\Keepalive\Keepalive;
use RongCloud\Lib\Chatroom\Whitelist\Whitelist;
use RongCloud\Lib\Chatroom\Whitelist\Message;
class Chatroom
{
/**
* 聊天室模块路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Chatroom constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'verify.json');
}
/**
* 聊天室创建
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'chatroom9992',//聊天室 id
'name'=> 'RongCloud',//聊天室名称
];
* @return mixed|null
*/
public function create(array $Chatroom=[]){
if(!isset($Chatroom[0])){
$Chatroom = [$Chatroom];
}
$conf = $this->conf['create'];
$verify = $this->verify['chatroom'];
$verify = ['id'=>$verify['id'],'name'=>$verify['name']];
$data = [];
foreach ($Chatroom as $v){
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $v,
'verify'=> $verify
]);
if($error) return $error;
$data["chatroom[{$v['id']}]"] = $v['name'];
}
$result = (new Request())->Request($conf['url'],$data);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 销毁聊天室
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'chatroom9992',//聊天室 id
];
* @return mixed|null
*/
public function destory(array $Chatroom=[]){
$conf = $this->conf['destory'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=> 'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取聊天室信息
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'chatroom9992',//聊天室 Id
'count'=>10,//聊天室成员信息数,最多返回 500 个成员
'order'=>2//查询聊天室成员顺序, 1: 加入时间正序 2: 加入时间倒序
];
* @return mixed|null
*/
public function get(array $Chatroom=[]){
$conf = $this->conf['get'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=> 'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 检查用户是否在聊天室
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'chatroom9992',//聊天室 id
'members'=>[
['id'=>"sea9902"]//人员id
]
];
* @return mixed|null
*/
public function isExist(array $Chatroom=[]){
$conf = $this->conf['isExist'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=> 'chatroomId',
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['result'=>'members']);
foreach ($result['members'] as $k=>&$v){
$v = (new Utils())->rename($v,['userId'=>'id']);
}
}
return $result;
}
/**
* 创建聊天室全局禁言对象
*
* @return Ban
*/
public function Ban(){
return new Ban();
}
/**
* 创建聊天室封禁对象
*
* @return Block
*/
public function Block(){
return new Block();
}
/**
* 创建聊天室消息降级对象
*
* @return Demotion
*/
public function Demotion(){
return new Demotion();
}
/**
* 创建聊天室消息分发对象
*
* @return Distribute
*/
public function Distribute(){
return new Distribute();
}
/**
* 创建聊天室成员禁言对象
*
* @return Gag
*/
public function Gag(){
return new Gag();
}
/**
* 创建聊天室包活对象
*
* @return Keepalive
*/
public function Keepalive(){
return new Keepalive();
}
/**
* 创建聊天室用户白名单对象
*
* @return Whitelist
*/
public function Whitelist(){
return new Whitelist();
}
/**
* 创建聊天室白名单消息对象
*
* @return Message
*/
public function Message(){
return new Message();
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室消息降级
*/
namespace RongCloud\Lib\Chatroom\Demotion;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Demotion {
/**
* 聊天室成消息降级路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Demotion/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Demotion constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加应用内聊天室降级消息
*
* @param array $Chatroom
* $Chatroom = [
'msgs'=> ['RC:TxtMsg03','RC:TxtMsg02']// 消息类型列表
];
* @return mixed|null
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['demotion'] ;
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'demotion',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'msgs'=>'objectName',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 移除应用内聊天室降级消息
*
* @param array $Chatroom
* $Chatroom = [
'msgs'=> ['RC:TxtMsg03','RC:TxtMsg02']// 消息类型列表
];
* @return mixed|null
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['demotion'] ;
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'demotion',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'msgs'=>'objectName',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取应用内聊天室降级消息
*
* @param array $Chatroom
* $Chatroom = [
];
* @return mixed|null
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_add",
"url": "chatroom/message/priority/add",
"params": {
"demotion": {
"msgs": ["RC:TxtMsg", "RC:ImgMsg"]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1502": {
"code": "1502",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_remove",
"url": "chatroom/message/priority/remove",
"params": {
"demotion": {
"msgs": ["RC:TxtMsg", "RC:ImgMsg"]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1502": {
"code": "1502",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_query",
"url": "chatroom/message/priority/query",
"params": {},
"response": {
"success": {
"code": 200,
"objectNames": ["RC:ImgMsg", "RC:ImgTextMsg", "RC:VcMsg"]
},
"fail": {
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室消息分发
*/
namespace RongCloud\Lib\Chatroom\Distribute;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Distribute {
/**
* 停止聊天室消息分发路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Distribute/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Distribute constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 停止聊天室消息分发
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
];
* @return mixed|null
*/
public function stop(array $Chatroom=[]){
$conf = $this->conf['stop'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 恢复聊天室消息分发
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
];
* @return mixed|null
*/
public function resume(array $Chatroom=[]){
$conf = $this->conf['resume'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
}
\ No newline at end of file
... ...
{
"stop": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_message_stop_distribution",
"url": "chatroom/message/stopDistribution",
"params": {
"chatroom": {
"id": "chatroom01"
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"resume": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_message_resume_distribution",
"url": "chatroom/message/resumeDistribution",
"params": {
"chatroom": {
"id": "chatroom01"
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室成员禁言
*/
namespace RongCloud\Lib\Chatroom\Gag;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Gag {
/**
* 聊天室成员禁言路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Gag/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Gag constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加成员禁言
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
'members'=> [
['id'=>'seal9901']//禁言成员 id
],
'minute'=>30//禁言时长
];
* @return mixed|null
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members'],'minute'=>$verify['minute']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'members'=>'userId',
'id'=>'chatroomId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 解除聊天室成员禁言
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
'members'=> [
['id'=>'seal9901']//人员 id
]
];
* @return mixed|null
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取聊天室成员禁言列表
*
* @param array $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
];
* @return mixed|null
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['users'=>'members']);
foreach ($result['members'] as $k=>&$v){
$v = (new Utils())->rename($v,['userId'=>'id']);
}
}
return $result;
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_gag_add",
"url": "chatroom/user/gag/add",
"params": {
"chatroom": {
"members": [{
"id": "akfj0a1"
}],
"minute": 100
}
},
"response": {
"success": {
"code": 200,
"msg": "成功返回"
},
"fail": {
"1502": {
"code": "1502",
"msg": "封禁时间不正确, 当前传入为 {{size}}, 正确范围 1 - 1 * 30 * 24 * 60 分钟"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_gag_remove",
"url": "chatroom/user/gag/rollback",
"params": {
"chatroom": {
"members": [{
"id": "akfj0a1"
}]
}
},
"response": {
"success": {
"code": 200,
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_gag_query",
"url": "chatroom/user/gag/list",
"params": {
"chatroom": {
"id": "chatroom-01"
}
},
"response": {
"success": {
"code": "200",
"members": [{
"time": "2015-09-25 16:12:38",
"id": "2582"
}]
},
"fail": {
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室保活
*/
namespace RongCloud\Lib\Chatroom\Keepalive;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Keepalive {
/**
* 聊天室保活路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Keepalive/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Keepalive constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加保活聊天室
*
* @param $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
];
* @return mixed|null
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 删除保活聊天室
*
* @param $Chatroom
* $Chatroom = [
'id'=> 'ujadk90ha',//聊天室 id
];
* @return mixed|null
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取保活聊天室
*
* @param $Chatroom
* $Chatroom = [
];
* @return mixed|null
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200 || $result['code'] == 0){
$result = (new Utils())->rename($result,['chatroomIds'=>'chatrooms']);
$result['code'] = 200;
}
return $result;
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_keepalive_add",
"url": "chatroom/keepalive/add",
"params": {
"chatroom": {
"id": "chatroomId01"
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_keepalive_remove",
"url": "chatroom/keepalive/remove",
"params": {
"chatroom": {
"id": "chatroomId01"
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_keepalive_query",
"url": "chatroom/keepalive/query",
"params": {},
"response": {
"success": {
"code": "200",
"chatrooms": ["chatroomId1", "chatroomId2"]
},
"fail": {
"1005": {
"code": "1005",
"msg": "chatroomId 长度超限, chatroomId >= 1 且 chatroomId <= 64 单位: 字节"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室消息白名单
*/
namespace RongCloud\Lib\Chatroom\Whitelist;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Message {
/**
* 聊天室消息白名单路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Whitelist/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Message constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'message-api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加聊天室消息白名单
*
* @param $Chatroom
* $Chatroom = [
'msgs'=> ["RC:TxtMsg"]//消息类型列表
]
* @return array
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['demotion'] ;
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'msgs'=>'objectnames',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 删除聊天室消息白名单
*
* @param $Chatroom
* $Chatroom = [
'msgs'=> ["RC:TxtMsg"]//消息类型列表
]
* @return array
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['demotion'] ;
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'msgs'=>'objectnames',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取聊天室消息白名单
*
* @param $Chatroom
* $Chatroom = [
]
* @return array
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['whitlistmsgType'=>'objectNames']);
}
return $result;
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室用户白名单
*/
namespace RongCloud\Lib\Chatroom\Whitelist;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class User {
/**
* 聊天室白名单用户模块路径
*
* @var string
*/
private $jsonPath = 'Lib/Chatroom/Whitelist/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Keepalive constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'user-api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');;
}
/**
* 添加聊天室用户白名单
*
* @param $Chatroom
* $Chatroom = [
'id'=> "chatroom1",//聊天室 id
'members'=>['abc','abcd']//用户列表
]
* @return array
*/
public function add(array $Chatroom=[]){
$conf = $this->conf['add'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 移除聊天室用户白名单
*
* @param $Chatroom
* $Chatroom = [
'id'=> "chatroom1",//聊天室 id
'members'=>['abc','abcd']//用户列表
]
* @return array
*/
public function remove(array $Chatroom=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id'],'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Chatroom['members'] as &$v){
$v = $v['id'];
}
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
'members'=>'userId'
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取聊天室用户白名单
*
* @param $Chatroom
* $Chatroom = [
]
* @return array
*/
public function getList(array $Chatroom=[]){
$conf = $this->conf['getList'];
$verify = $this->verify['chatroom'] ;
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'chatroom',
'data'=> $Chatroom,
'verify'=> $verify
]);
if($error) return $error;
$Chatroom = (new Utils())->rename($Chatroom, [
'id'=>'chatroomId',
]);
$result = (new Request())->Request($conf['url'],$Chatroom);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['users'=>'members']);
foreach ($result['members'] as $k=>$v){
$result['members'][$k] = ['id'=>$v];
}
}
return $result;
}
}
\ No newline at end of file
... ...
<?php
/**
* 聊天室白名单
*/
namespace RongCloud\Lib\Chatroom\Whitelist;
use RongCloud\Lib\Chatroom\Whitelist\User;
use RongCloud\Lib\Chatroom\Whitelist\Message;
class Whitelist {
/**
* 获取连天使白名单消息对象
*
* @return Message
*/
public function Message(){
return new Message();
}
/**
* 获取连天使白名单用户对象
*
* @return User
*/
public function User(){
return new User();
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_whitelist_add",
"url": "chatroom/whitelist/add",
"params": {
"chatroom": {
"msgs": ["RC:TxtMsg01"]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_whitelist_remove",
"url": "chatroom/whitelist/delete",
"params": {
"chatroom": {
"msgs": ["RC:TxtMsg01"]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_whitelist_query",
"url": "chatroom/whitelist/query",
"params": {},
"response": {
"success": {
"code": "200",
"objectNames": ["RC:TxtMsg"]
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_whitelist_add",
"url": "chatroom/user/whitelist/add",
"params": {
"chatroom": {
"id": "chatroomId01",
"members": [{
"id": "memberId01"
}]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_message_priority_remove",
"url": "chatroom/user/whitelist/remove",
"params": {
"chatroom": {
"id": "chatroomId01",
"members": [{
"id": "memberId01"
}]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_whitelist_query",
"url": "chatroom/user/whitelist/query",
"params": {
"chatroom": {
"id": "chatroomId01"
}
},
"response": {
"success": {
"code": "200",
"members": ["member1", "member2"]
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
{
"create": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_create",
"url": "chatroom/create",
"params": {
"chatroom": {
"id": "chatroomId01",
"name": "大融云"
}
},
"response": {
"success": {
"code": 200,
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"destory": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_destroy",
"url": "chatroom/destroy",
"params": {
"chatroom": {
"id": "chatroomId01"
}
},
"response": {
"success": {
"code": 200,
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "{{name}} 类型不正确,请检查参数类型,应该为 Object 传入为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"get": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_user_query",
"url": "chatroom/user/query",
"params": {
"chatroom": {
"id": "chatromId01",
"count": 10,
"order": 1
}
},
"response": {
"success": {
"code": 200,
"total": 1000,
"members": [{
"id": "member1",
"time": "2015-09-10 16:38:26"
}, {
"id": "member2",
"time": "2015-09-10 16:38:26"
}]
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"isExist": {
"docs": "http://rongcloud.cn/docs/server.html#chatroom_users_exist",
"url": "chatroom/users/exist",
"params": {
"chatroom": {
"id": "chatroom01",
"members": [{
"id": "memberId01"
}]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 数量超限,{{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
{
"chatroom": {
"_self": {
"require": {
"must": true,
"invalid": "1002"
}
},
"id": {
"require": {
"must": true,
"invalid": "1002"
}
},
"name": {
"require": {
"must": true,
"invalid": "1002"
}
},
"members": {
"require": {
"must": true,
"invalid": "1002"
},
"typeof": {
"type": "array",
"invalid": "1501"
}
},
"minute": {
"require": {
"must": true,
"invalid": "1002"
},
"size": {
"max": 43200,
"min": 1,
"invalid": "1502"
},
"typeof": {
"type": "number",
"invalid": "1501"
}
}
},
"demotion": {
"_self": {
"require": {
"must": true,
"invalid": "1002"
}
},
"msgs": {
"require": {
"must": true,
"invalid": "1002"
},
"typeof": {
"type": "array",
"invalid": "1501"
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 会话模块
* conversation=> hejinyu
* Date=> 2018/7/23
* Time=> 11=>41
*/
namespace RongCloud\Lib\Conversation;
use RongCloud\Lib\ConversationType;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Conversation
{
/**
* 会话模块路径
*
* @var string
*/
private $jsonPath = 'Lib/Conversation/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Conversation constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'verify.json');
}
/**
* 屏蔽会话 Push
*
* @param $Conversation array 屏蔽会话 Push 参数
* @param
* $Conversation = [
'type'=> 'PRIVATE',//会话类型 PRIVATE、GROUP、DISCUSSION、SYSTEM
'userId'=>'mka091amn',//会话所有者
'targetId'=>'adm1klnm'//会话 id
];
* @return array
*/
public function mute(array $Conversation=[]){
$conf = $this->conf['mute'];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'conversation',
'data'=> $Conversation,
'verify'=> $this->verify['conversation']
]);
if($error) return $error;
$Conversation['type'] = ConversationType::t()[$Conversation['type']];
$Conversation['isMuted'] = 1;
$Conversation = (new Utils())->rename($Conversation, [
'type'=> 'conversationType',
'userId'=> 'requestId'
]);
$result = (new Request())->Request($conf['url'],$Conversation);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 接收会话 Push
*
* @param $Conversation array 接收会话 Push 参数
* @param
* $Conversation = [
'type'=> 'PRIVATE',//会话类型 PRIVATE、GROUP、DISCUSSION、SYSTEM
'userId'=>'mka091amn',//会话所有者
'targetId'=>'adm1klnm'//会话 id
];
* @return array
*/
public function unmute(array $Conversation=[]){
$conf = $this->conf['mute'];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'conversation',
'data'=> $Conversation,
'verify'=> $this->verify['conversation']
]);
if($error) return $error;
$Conversation['type'] = ConversationType::t()[$Conversation['type']];
$Conversation['isMuted'] = 0;
$Conversation = (new Utils())->rename($Conversation, [
'type'=> 'conversationType',
'userId'=> 'requestId'
]);
$result = (new Request())->Request($conf['url'],$Conversation);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 免打扰会话状态获取
*
* @param $Conversation array 接收会话 Push 参数
* @param
* $Conversation = [
'type'=> 'PRIVATE',//会话类型 PRIVATE、GROUP、DISCUSSION、SYSTEM
'userId'=>'mka091amn',//会话所有者
'targetId'=>'adm1klnm'//会话 id
];
* @return array
*/
public function get(array $Conversation=[]){
$conf = $this->conf['mute'];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'conversation',
'data'=> $Conversation,
'verify'=> $this->verify['conversation']
]);
if($error) return $error;
$Conversation['type'] = ConversationType::t()[$Conversation['type']];
$Conversation['isMuted'] = 0;
$Conversation = (new Utils())->rename($Conversation, [
'type'=> 'conversationType',
'userId'=> 'requestId'
]);
$result = (new Request())->Request($conf['url'],$Conversation);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
}
\ No newline at end of file
... ...
{
"mute": {
"docs": "http://rongcloud.cn/docs/server.html#conversation_notification_set",
"url": "conversation/notification/set",
"params": {
"conversation": {
"type": "1",
"targetId": "UAhIaLkR0",
"userId": "b5NwvIrW8"
}
},
"response":{
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"unmute": {
"docs": "http://rongcloud.cn/docs/server.html#conversation_notification_set",
"url": "conversation/notification/set",
"params": {
"conversation": {
"type": "1",
"targetId": "UAhIaLkR0",
"userId": "b5NwvIrW8"
}
},
"response":{
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
{
"conversation": {
"_self": {
"require": {
"must": true,
"invalid": "1002"
},
"typeof": {
"type": "object",
"invalid": "1501"
}
},
"type": {
"require": {
"must": true,
"invalid": "1002"
}
},
"targetId": {
"require": {
"must": true,
"invalid": "1002"
},
"length": {
"max": 64,
"min": 1,
"invalid": "1005"
}
},
"userId": {
"require": {
"must": true,
"invalid": "1002"
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 会话类型
*/
namespace RongCloud\Lib;
class ConversationType{
static function t(){
return $Conversation = [
'PRIVATE'=> 1,
'DISCUSSION'=> 2,
'GROUP'=> 3,
'CHATROOM'=>4,
'CUSTOMER_SERVICE'=> 5,
'SYSTEM'=> 6,
'APP_PUBLIC'=> 7,
'PUBLIC'=> 8
];
}
}
... ...
<?php
/**
* 群组禁言
* @author hejinyu
*/
namespace RongCloud\Lib\Group\Gag;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Gag
{
/**
* 群组模块路径
*
* @var string
*/
private $jsonPath = 'Lib/Group/Gag/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Conversation constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');
}
/**
* 添加群组禁言
*
* @param $Group array 添加群组禁言 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//群组 id
'members'=>[ //禁言人员列表
['id'=> 'ujadk90ha']
]
,
'minute'=>50 // 禁言时长
];
* @return array
*/
public function add(array $Group=[]){
$conf = $this->conf['add'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id'], 'members'=>$verify['members']];
$verify = array_merge($verify , ['minute'=>$verify['minute']]);
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Group['members'] as &$v){
$v = $v['id'];
}
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'members'=> 'userId'
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 解除禁言
*
* @param $Group array 解除禁言 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//群组 id
'members'=>[ //解除禁言人员列表
['id'=> 'ujadk90ha']
]
];
* @return array
*/
public function remove(array $Group=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id'], 'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
foreach ($Group['members'] as &$v){
$v = $v['id'];
}
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'members'=> 'userId'
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 查询禁言成员列表
*
* @param $Group array 解除禁言 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//群组 id
];
* @return array
*/
public function getList(array $Group=[]){
$conf = $this->conf['getList'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200){
$result = (new Utils())->rename($result,['users'=>'members']);
foreach ($result['members']?:[] as $k=>&$v){
$v = (new Utils())->rename($v,['userId'=>'id']);
}
}
return $result;
}
}
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#group_user_gag_add",
"url": "group/user/gag/add",
"params": {
"group": {
"id": "10001",
"members": [{"id": "aFo990k"}],
"minute": 60
}
},
"response":{
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
},
"1502": {
"code": "1502",
"msg": "封禁时间不正确, 当前传入为 {{size}}, 正确范围 1 - 1 * 30 * 24 * 60 分钟"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#group_user_gag_rollback",
"url": "group/user/gag/rollback",
"params": {
"group": {
"id": "10001",
"members": [{"id": "aFo990k"}]
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#group_user_gag_list",
"url": "group/user/gag/list",
"params": {
"group": {
"id": "10001"
}
},
"response":{
"success": {
"code": "200",
"users": [{
"time": "2015-09-25 16:12:38",
"member": {
"id": "2582"
}
}]
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* 群组模块
* @author hejinyu
*/
namespace RongCloud\Lib\Group;
use RongCloud\Lib\Group\Gag\Gag;
use RongCloud\Lib\Group\MuteAllMembers\MuteAllMembers;
use RongCloud\Lib\Group\MuteWhiteList\MuteWhiteList;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class Group
{
/**
* 群组模块路径
*
* @var string
*/
private $jsonPath = 'Lib/Group/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Conversation constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'verify.json');
}
/**
* 同步群组信息
*
* @param $Group array 同步群组信息 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//用户id
'groups'=>[['id'=> 'group9998', 'name'=> 'RongCloud']]//用户群组信息
];
* @return array
*/
public function sync(array $Group=[]){
$conf = $this->conf['sync'];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'user',
'data'=> $Group,
'verify'=> $this->verify['user']
]);
if($error) return $error;
$data = [];
$data['group'] = array_column($Group['groups'],'name', 'id');
$data['userId'] = $Group['id'];
$result = (new Request())->Request($conf['url'],$data);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 创建群组
*
* @param $Group array 创建群组 参数
* @param
* $Group = [
'id'=> 'watergroup1',//群组 id
'name'=> 'watergroup',//群组名称
'members'=>[ //群成员 列表
['id'=> 'group9991111113']
]
];
* @return array
*/
public function create(array $Group=[]){
$conf = $this->conf['create'];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $this->verify['group']
]);
if($error) return $error;
foreach ($Group['members'] as &$v){
$v = $v['id'];
}
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'name'=> 'groupName',
'members'=> 'userId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 加入群组
*
* @param $Group array 加入群组 参数
* @param
* $Group = [
'id'=> 'watergroup',//群组 id
'name'=>"watergroup",//群组名称
'member'=>['id'=> 'group999'],//群成员信息
];
* @return array
*/
public function joins(array $Group=[]){
$conf = $this->conf['join'];
$verify = $this->verify['group'];
unset($verify['memberIds'],$verify['name']);
$verify = array_merge($verify,$this->verify['member']);
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group['member'] = isset($Group['member']['id'])?$Group['member']['id']:"";
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'name'=> 'groupName',
'member'=> 'userId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 退出群组
*
* @param $Group array 退出群组 参数
* @param
* $Group = [
'id'=> 'watergroup',//群组 id
'member'=>['id'=> 'group999'],//群成员信息
];
* @return array
*/
public function quit(array $Group=[]){
$conf = $this->conf['quit'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id']];
$verify = array_merge($verify,$this->verify['member']);
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group['member'] = isset($Group['member']['id'])?$Group['member']['id']:"";
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'member'=> 'userId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 解散群组
*
* @param $Group array 解散群组 参数
* @param
* $Group = [
'id'=> 'watergroup',//群组 id
'member'=>['id'=> 'group999'],//管理员信息
];
* @return array
*/
public function dismiss(array $Group=[]){
$conf = $this->conf['dismiss'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group['member'] = isset($Group['member']['id'])?$Group['member']['id']:"";
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'member'=> 'userId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 修改群信息
*
* @param $Group array 修改群信息 参数
* @param
* $Group = [
'id'=> 'watergroup',//群组 id
'name'=>"watergroup"//群名称
];
* @return array
*/
public function update(array $Group=[]){
$conf = $this->conf['update'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id'],'name'=>$verify['name']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
'name'=> 'groupName',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 获取群信息
*
* @param $Group array 获取群信息 参数
* @param
* $Group = [
'id'=> 'watergroup',//群组 id
];
* @return array
*/
public function get(array $Group=[]){
$conf = $this->conf['get'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
if($result['code'] == 200) {
$result = (new Utils())->rename($result, [
'users'=> 'members',
]);
}
return $result;
}
/**
* 创建群组禁言对象
*
* @return Gag
*/
public function Gag(){
return new Gag();
}
/**
* 创建指定群组全员禁言
*
* @return MuteAllMembers
*/
public function MuteAllMembers(){
return new MuteAllMembers();
}
/**
* 创建指定群组全员禁言
*
* @return MuteWhiteList
*/
public function MuteWhiteList(){
return new MuteWhiteList();
}
}
\ No newline at end of file
... ...
<?php
/**
* 指定群组全部成员禁言
* @author hejinyu
*/
namespace RongCloud\Lib\Group\MuteAllMembers;
use RongCloud\Lib\Request;
use RongCloud\Lib\Utils;
class MuteAllMembers
{
/**
* 群组模块路径
*
* @var string
*/
private $jsonPath = 'Lib/Group/MuteAllMembers/';
/**
* 请求配置文件
*
* @var string
*/
private $conf = "";
/**
* 校验配置文件
*
* @var string
*/
private $verify = "";
/**
* Conversation constructor.
*/
function __construct()
{
$this->conf = Utils::getJson($this->jsonPath.'api.json');
$this->verify = Utils::getJson($this->jsonPath.'../verify.json');
}
/**
* 添加群组禁言
*
* @param $Group array 添加群组禁言 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//群组 id
];
* @return array
*/
public function add(array $Group=[]){
$conf = $this->conf['add'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id'], 'members'=>$verify['members']];
$verify = array_merge($verify , ['minute'=>$verify['minute']]);
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 解除禁言
*
* @param $Group array 解除禁言 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//群组 id
'members'=>[ //解除禁言人员列表
['id'=> 'ujadk90ha']
]
];
* @return array
*/
public function remove(array $Group=[]){
$conf = $this->conf['remove'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id'], 'members'=>$verify['members']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
/**
* 查询禁言成员列表
*
* @param $Group array 解除禁言 参数
* @param
* $Group = [
'id'=> 'ujadk90ha',//群组 id
];
* @return array
*/
public function getList(array $Group=[]){
$conf = $this->conf['getList'];
$verify = $this->verify['group'];
$verify = ['id'=>$verify['id']];
$error = (new Utils())->check([
'api'=> $conf,
'model'=> 'group',
'data'=> $Group,
'verify'=> $verify
]);
if($error) return $error;
$Group = (new Utils())->rename($Group, [
'id'=> 'groupId',
]);
$result = (new Request())->Request($conf['url'],$Group);
$result = (new Utils())->responseError($result, $conf['response']['fail']);
return $result;
}
}
... ...
{
"add": {
"docs": "http://rongcloud.cn/docs/server.html#group_user_ban_add",
"url": "group/ban/add",
"params": {
"group": {
"id": "10001"
}
},
"response":{
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"remove": {
"docs": "http://rongcloud.cn/docs/server.html#group_user_ban_rollback",
"url": "group/ban/rollback",
"params": {
"group": {
"id": "10001"
}
},
"response": {
"success": {
"code": "200",
"msg": "成功返回"
},
"fail": {
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}} "
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
},
"getList": {
"docs": "http://rongcloud.cn/docs/server.html#group_user_ban_query",
"url": "group/ban/query",
"params": {
"group": {
}
},
"response":{
"success": {
"code": "200",
"users": [{
"time": "2015-09-25 16:12:38",
"member": {
"id": "2582"
}
}]
},
"fail": {
"1005": {
"code": "1005",
"msg": "{{name}} 长度超限, {{name}} >= {{min}} 且 {{name}} <= {{max}}"
},
"1002": {
"code": "1002",
"msg": "{{name}} 参数为必传项"
},
"1501": {
"code": "1501",
"msg": "参数类型不正确,请检查参数类型,应该为 {{type}} 当前为 {{currentType}}"
},
"1004": {
"code": "1004",
"msg": "签名错误, 请排查 Appkey、Secret 是否正确"
},
"1008": {
"code": "1008",
"msg": "调用频率超限,每秒钟限制 100 次,调整频率上限请移步至专有云 http://www.rongcloud.cn/pricing#pay"
}
}
}
}
}
\ No newline at end of file
... ...