You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: reading.go
    path of file: ./repos/studygolang/internal/logic
    
    the code of the file until where you have to start completion: // Copyright 2016 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris	polaris@studygolang.com

package logic

import (
	"errors"
	"net/url"
	"strconv"
	"strings"

	. "github.com/studygolang/studygolang/db"
	"github.com/studygolang/studygolang/internal/model"

	"github.com/polaris1119/logger"
	"golang.org/x/net/context"
)

type ReadingLogic struct{}

var DefaultReading = ReadingLogic{}

func (ReadingLogic) FindLastList(beginTime string) ([]*model.MorningReading, error) {
	readings := make([]*model.MorningReading, 0)
	err := MasterDB.Where("ct
    
func (ReadingLogic) SaveReading(ctx context.Context, form url.Values, username string) (errMsg string, err error) {
	reading := &model.MorningReading{}
	err = schemaDecoder.Decode(reading, form)
	if err != nil {
		logger.Errorln("reading SaveReading error", err)
		errMsg = err.Error()
		return
	}

	readings := make([]*model.MorningReading, 0)
	if reading.Inner != 0 {
		reading.Url = ""
		err = MasterDB.Where("`inner`=?", reading.Inner).OrderBy("id DESC").Find(&readings)
	} else {
		err = MasterDB.Where("url=?", reading.Url).OrderBy("id DESC").Find(&readings)
	}
	if err != nil {
		logger.Errorln("reading SaveReading MasterDB.Where() error", err)
		errMsg = err.Error()
		return
	}

	reading.Moreurls = strings.TrimSpace(reading.Moreurls)
	if strings.Contains(reading.Moreurls, "\n") {
		reading.Moreurls = strings.Join(strings.Split(reading.Moreurls, "\n"), ",")
	}

	reading.Username = username

	logger.Debugln(reading.Rtype, "id=", reading.Id)
	if reading.Id != 0 {
		_, err = MasterDB.ID(reading.Id).Update(reading)
	} else {
		if len(readings) > 0 {
			logger.Errorln("reading report:", reading)
			errMsg, err = "已经存在了!!", errors.New("已经存在了!!")
			return
		}
		_, err = MasterDB.Insert(reading)
	}

	if err != nil {
		errMsg = "内部服务器错误"
		logger.Errorln("reading save:", errMsg, ":", err)
		return
	}

	return
}