Example #1
0
        public async Task <IActionResult> TopicMessageAsync([FromBody] TopicMessageRequestDto request)
        {
            var doctorBiz = new DoctorBiz();
            var response  = await doctorBiz.TopicMessageAsync(request);

            return(Success(response));
        }
Example #2
0
        public async Task <TopicMessageResponseDto> TopicMessageAsync(TopicMessageRequestDto request)
        {
            var whereSql = "1=1 and enable=1";

            if (!string.IsNullOrWhiteSpace(request.TopicGuid))
            {
                whereSql = $"{whereSql} and Topic_Guid=@TopicGuid ";
            }
            var    orderbySql = "creation_date desc";
            string sql        = $@"
SELECT * FROM(
    SELECT
	    a.* ,
	    b.user_name AS from_name,
	    c.user_name AS to_name 
    FROM
	    t_utility_message a 
	    LEFT JOIN t_utility_user b ON a.from_guid = b.user_guid
	    LEFT JOIN t_utility_user c ON a.to_guid = c.user_guid
)__T
WHERE
    {whereSql}
ORDER BY
    {orderbySql}
";

            return(await MySqlHelper.QueryByPageAsync <TopicMessageRequestDto, TopicMessageResponseDto, TopicMessageItemDto>(sql, request));
        }