Commit 14ded93f authored by 黄奎's avatar 黄奎

接口修改

parent 4bb317ba
......@@ -32,5 +32,12 @@ namespace EduSpider.IRepository
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowTypeRepository(int ShowType, string Ids);
/// <summary>
/// 根据编号删除学员评论
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool DeleteStuCommentRepository(string Ids)
}
}
......@@ -101,5 +101,12 @@ namespace EduSpider.IServices
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowType(int ShowType, string Ids);
/// <summary>
/// 根据编号删除学员评论
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool RemoveStuComment(string Ids);
}
}
......@@ -64,5 +64,10 @@ namespace EduSpider.Model.Entity
/// 显示类型(1-全部可见,2-部分可见,3-不可见)
/// </summary>
public int ShowType { get; set; }
/// <summary>
/// 删除状态(0-正常,1-删除)
/// </summary>
public int Status { get; set; }
}
}
......@@ -29,6 +29,7 @@ SELECT A.*
FROM RB_Stu_Comment AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}=0 ", nameof(RB_Stu_Comment.Status));
if (query != null)
{
if (query.CourseId > 0)
......@@ -83,5 +84,16 @@ WHERE 1=1
string sql = string.Format("UPDATE RB_Stu_Comment SET ShowType={0} WHERE Id IN({1}) ", ShowType, Ids);
return base.Execute(sql) > 0;
}
/// <summary>
/// 根据编号删除学员评论
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool DeleteStuCommentRepository(string Ids)
{
string sql = string.Format("UPDATE RB_Stu_Comment SET Status=1 WHERE Id IN({0}) ", Ids);
return base.Execute(sql) > 0;
}
}
}
......@@ -367,5 +367,16 @@ namespace EduSpider.Services
{
return StuCommentRepository.SetStuCommentShowTypeRepository(ShowType, Ids);
}
/// <summary>
/// 根据编号删除学员评论
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
public bool RemoveStuComment(string Ids)
{
return StuCommentRepository.DeleteStuCommentRepository(Ids);
}
}
}
\ No newline at end of file
......@@ -247,6 +247,8 @@ namespace EduSpider.WebApi.Controllers
Info = base.ReqParameters.GetString("Info"),
CreateType = base.ReqParameters.GetInt("CreateType"),
};
model.ShowType = 3;
model.Status = 0;
model.CreateTime = System.DateTime.Now;
model.CreateBy = base.BaseUserId;
model.CreateByName = base.UserInfo.AccountName;
......@@ -285,5 +287,23 @@ namespace EduSpider.WebApi.Controllers
var list = CourseService.GetStuCommentList(query);
return ApiResult.Success(data: list);
}
[HttpPost]
[HttpGet]
/// <summary>
/// 删除学生评论
/// </summary>
/// <returns></returns>
public ApiResult RemoveStuComment()
{
string Ids = base.ReqParameters.GetString("Ids");
if (string.IsNullOrEmpty(Ids))
{
return ApiResult.ParamIsNull(message: "请选择要删除的评论!");
}
var list = CourseService.RemoveStuComment(Ids);
return ApiResult.Success(data: list);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment