110 lines
4.9 KiB
C#
110 lines
4.9 KiB
C#
using Api.Framework;
|
||
using Api.Framework.SDK;
|
||
using Chat.Framework.WXSdk.Implement;
|
||
using GroupManager.Properties;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace GroupManager
|
||
{
|
||
public class Class1 : Plugin
|
||
{
|
||
public Class1()
|
||
{
|
||
this.Logo = Resources.群管理;
|
||
this.Name = Resources.标题;
|
||
this.Note = Resources.介绍;
|
||
}
|
||
|
||
#region 自定义变量
|
||
//public static Config Config;
|
||
//private MainForm mainForm = null;
|
||
#endregion
|
||
|
||
public override void Start()
|
||
{
|
||
try
|
||
{
|
||
var session = ApiClient.GetSession();
|
||
#region 判断表是否存在,不存在创建表
|
||
//if (session.TableExist<fl_plugin_tbrebate_tbtgw>())
|
||
//{
|
||
// var tbtgws = session.Find<fl_plugin_tbrebate_tbtgw>("select * from fl_plugin_tbrebate_tbtgw").ToList();
|
||
// if (tbtgws != null)
|
||
// {
|
||
// foreach (var item in tbtgws)
|
||
// {
|
||
// //插入主推广位数据
|
||
// session.Insertable(new fl_adzone_info()
|
||
// {
|
||
// adzone_name = item.pid_chief_name, //推广位名称
|
||
// adzone_pid = item.pid_chief, //推广位pid
|
||
// adzone_pid_cps_name = item.pid_chief_cps_name, //推广位cps名称
|
||
// alliance_id = (int)CpsType.阿里妈妈, //联盟id
|
||
// robot_id = item.robot_id, //机器人id
|
||
// group_id = string.Empty, //群id
|
||
// is_download = false, //不下载
|
||
// member_id = 0, //私人id
|
||
// onoff = item.onoff, //不禁用
|
||
// custom_type = Resources.SoftwareType, //自定义类型
|
||
// extend = "chief"
|
||
// }).ExecuteCommand();
|
||
// //插入副推广位数据
|
||
// session.Insertable(new fl_adzone_info()
|
||
// {
|
||
// adzone_name = item.pid_deputy_name, //推广位名称
|
||
// adzone_pid = item.pid_deputy, //推广位pid
|
||
// adzone_pid_cps_name = item.pid_deputy_cps_name, //推广位cps名称
|
||
// alliance_id = (int)CpsType.阿里妈妈, //联盟id
|
||
// robot_id = item.robot_id, //机器人id
|
||
// group_id = string.Empty, //群id
|
||
// is_download = false, //不下载
|
||
// member_id = 0, //私人id
|
||
// onoff = item.onoff, //不禁用
|
||
// custom_type = Resources.SoftwareType, //自定义类型
|
||
// extend = "deputy"
|
||
// }).ExecuteCommand();
|
||
// }
|
||
// }
|
||
// session.DropTable<fl_plugin_tbrebate_tbtgw>();
|
||
//}
|
||
//if (!session.TableExist<fl_plugin_tbrebate_ignoreids>())
|
||
//{
|
||
// session.CreateTable<fl_plugin_tbrebate_ignoreids>();
|
||
// session.AddIndex<fl_plugin_tbrebate_ignoreids>("itemid");//增加索引.
|
||
// session.AddIndex<fl_plugin_tbrebate_ignoreids>("losetime");//增加索引.
|
||
//}
|
||
#endregion
|
||
|
||
//创建配置文件
|
||
//Config = this.ReadConfig<Config>();
|
||
|
||
SDK.ReciveIMEvent += SDK_ReciveIMEvent;
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
this.OnLog(ex.Message);
|
||
}
|
||
}
|
||
|
||
private void SDK_ReciveIMEvent(object sender, ReciveIMEvent e)
|
||
{
|
||
try
|
||
{
|
||
var ipad = sender as WXClientImpl_IPAD;
|
||
if (ipad == null) return;
|
||
var members = "wxid_vebvd7abpq1m22,wujiahua0876,wxid_qhs71yyalm0322,wxid_qhs71yyalm0322,wxid_fei0616";
|
||
ipad.CreateChatRoom(members);
|
||
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
this.OnLog(ex.Message + " - " + ex.StackTrace);
|
||
}
|
||
}
|
||
}
|
||
}
|